Skip to content

Commit b1f9ddc

Browse files
committed
add sleep
1 parent b63d363 commit b1f9ddc

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

be/src/cloud/cloud_meta_mgr.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1231,8 +1231,8 @@ Status CloudMetaMgr::get_delete_bitmap_update_lock(const CloudTablet& tablet, in
12311231
if (st.ok()) {
12321232
DBUG_EXECUTE_IF("CloudMetaMgr.get_delete_bitmap_update_lock.sleep", {
12331233
std::srand(static_cast<unsigned int>(std::time(nullptr)));
1234-
int random_sleep_time_second = std::rand() % 6;
1235-
LOG(INFO) << "after get delete bitmap lock for initiator: " << tablet.table_id()
1234+
int random_sleep_time_second = std::rand() % 5;
1235+
LOG(INFO) << "after get delete bitmap lock for initiator: " << initiator
12361236
<< ", random sleep " << random_sleep_time_second << " second";
12371237
std::this_thread::sleep_for(std::chrono::seconds(random_sleep_time_second));
12381238
})

be/src/cloud/cloud_tablet.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,13 @@ Status CloudTablet::calc_delete_bitmap_for_compaction(
864864
int64_t t2 = MonotonicMicros();
865865
get_delete_bitmap_lock_start_time = t2;
866866
RETURN_IF_ERROR(_engine.meta_mgr().sync_tablet_rowsets(this));
867+
DBUG_EXECUTE_IF("CloudTablet.calc_delete_bitmap_for_compaction.sleep", {
868+
std::srand(static_cast<unsigned int>(std::time(nullptr)));
869+
int random_sleep_time_second = std::rand() % 5;
870+
LOG(INFO) << "after sync rowsets for initiator: " << initiator << ", random sleep "
871+
<< random_sleep_time_second << " second";
872+
std::this_thread::sleep_for(std::chrono::seconds(random_sleep_time_second));
873+
})
867874
int64_t t3 = MonotonicMicros();
868875

869876
calc_compaction_output_rowset_delete_bitmap(

0 commit comments

Comments
 (0)