Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions be/src/cloud/cloud_tablet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,8 @@ Status CloudTablet::save_delete_bitmap(const TabletTxnInfo* txn_info, int64_t tx

DBUG_EXECUTE_IF("CloudTablet::save_delete_bitmap.injected_error", {
auto retry = dp->param<bool>("retry", false);
auto sleep_sec = dp->param<int>("sleep", 0);
std::this_thread::sleep_for(std::chrono::seconds(sleep_sec));
if (retry) { // return DELETE_BITMAP_LOCK_ERROR to let it retry
return Status::Error<ErrorCode::DELETE_BITMAP_LOCK_ERROR>(
"injected DELETE_BITMAP_LOCK_ERROR");
Expand Down
3 changes: 3 additions & 0 deletions be/src/cloud/cloud_txn_delete_bitmap_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ Status CloudTxnDeleteBitmapCache::get_tablet_txn_info(
if (delete_bitmap != nullptr) {
*delete_bitmap = std::make_shared<DeleteBitmap>(tablet_id);
}
// to avoid to skip calculating
**publish_status = PublishStatus::INIT;

return Status::OK();
}
return st;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-- This file is automatically generated. You should know what you did if you want to edit this
-- !sql --
1 1 1
2 2 2
3 3 3

-- !dup_key_count --
0

-- !sql --
1 999 999
2 2 2
3 3 3

Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

suite("test_cloud_publish_skip_calc_cache_miss", "nonConcurrent") {
if (!isCloudMode()) {
return
}

def customFeConfig = [
delete_bitmap_lock_expiration_seconds : 10,
calculate_delete_bitmap_task_timeout_seconds : 5,
]

setFeConfigTemporary(customFeConfig) {

def table1 = "test_cloud_publish_skip_calc_cache_miss"
sql "DROP TABLE IF EXISTS ${table1} FORCE;"
sql """ CREATE TABLE IF NOT EXISTS ${table1} (
`k1` int NOT NULL,
`c1` int,
`c2` int
)UNIQUE KEY(k1)
DISTRIBUTED BY HASH(k1) BUCKETS 1
PROPERTIES (
"enable_unique_key_merge_on_write" = "true",
"disable_auto_compaction" = "true",
"replication_num" = "1"); """

sql "insert into ${table1} values(1,1,1);"
sql "insert into ${table1} values(2,2,2);"
sql "insert into ${table1} values(3,3,3);"
sql "sync;"
order_qt_sql "select * from ${table1};"

try {
GetDebugPoint().clearDebugPointsForAllFEs()
GetDebugPoint().clearDebugPointsForAllBEs()

GetDebugPoint().enableDebugPointForAllBEs("CloudTxnDeleteBitmapCache::get_delete_bitmap.cache_miss")
// inject failure after saving its result in BE's delete bitmap cache successfully, so that later retry will
// try to skip to calculate
GetDebugPoint().enableDebugPointForAllBEs("CloudTablet::save_delete_bitmap.injected_error", [retry: true, sleep: 5])

def t1 = Thread.start {
sql "insert into ${table1} values(1,999,999);"
}

Thread.sleep(3000)

GetDebugPoint().disableDebugPointForAllBEs("CloudTablet::save_delete_bitmap.injected_error")

t1.join()

qt_dup_key_count "select count() from (select k1,count() as cnt from ${table1} group by k1 having cnt > 1) A;"
qt_sql "select * from ${table1} order by k1,c1,c2;"
} catch(Exception e) {
logger.info(e.getMessage())
throw e
} finally {
GetDebugPoint().clearDebugPointsForAllBEs()
GetDebugPoint().clearDebugPointsForAllFEs()
}
}
}
Loading