From f4072b7bcd78d2f515e4e30136636deaea7b40c1 Mon Sep 17 00:00:00 2001 From: Handora Date: Tue, 31 Dec 2024 15:15:16 +0000 Subject: [PATCH] [FEATURE] add sleep signal for lock for read --- deps/oblib/src/lib/wait_event/ob_wait_event.h | 1 + src/storage/ob_protected_memtable_mgr_handle.cpp | 1 - src/storage/tx/ob_tx_data_functor.cpp | 3 ++- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/deps/oblib/src/lib/wait_event/ob_wait_event.h b/deps/oblib/src/lib/wait_event/ob_wait_event.h index 162b7ab2b6..f4d3e078da 100644 --- a/deps/oblib/src/lib/wait_event/ob_wait_event.h +++ b/deps/oblib/src/lib/wait_event/ob_wait_event.h @@ -124,6 +124,7 @@ WAIT_EVENT_DEF(OBCDC_PART_MGR_SCHEMA_VERSION_WAIT, 18000, "oblog part mgr schema WAIT_EVENT_DEF(BACKUP_TMP_FILE_WAIT, 18001, "backup tmp file wait", "", "", "", CONCURRENCY, true, true) WAIT_EVENT_DEF(BACKUP_TMP_FILE_QUEUE_WAIT, 18002, "backup tmp file queue wait", "", "", "", CONCURRENCY, true, true) WAIT_EVENT_DEF(SYNC_GET_GTS_WAIT, 18101, "sync get gts timestamp wait", "address", "", "", NETWORK, true, true) +WAIT_EVENT_DEF(LOCK_FOR_READ_WAIT, 18102, "sleep: lock for read need wait for concurrency control", "sleep_interval", "", "", CONCURRENCY, true, true) //sleep WAIT_EVENT_DEF(BANDWIDTH_THROTTLE_SLEEP, 20000, "sleep: bandwidth throttle sleep wait", "sleep_interval", "", "", NETWORK, true, true) diff --git a/src/storage/ob_protected_memtable_mgr_handle.cpp b/src/storage/ob_protected_memtable_mgr_handle.cpp index 3573c32175..47848fd0f9 100644 --- a/src/storage/ob_protected_memtable_mgr_handle.cpp +++ b/src/storage/ob_protected_memtable_mgr_handle.cpp @@ -66,7 +66,6 @@ int ObProtectedMemtableMgrHandle::try_reset_memtable_mgr_handle_() int ret = OB_SUCCESS; SpinWLockGuard guard(memtable_mgr_handle_lock_); if (need_reset_without_lock_()) { - STORAGE_LOG(INFO, "memtable_mgr has no memtable, release it", KR(ret), KPC(this)); memtable_mgr_handle_.reset(); } return ret; diff --git a/src/storage/tx/ob_tx_data_functor.cpp b/src/storage/tx/ob_tx_data_functor.cpp index e5551f7d38..b33fe2cecf 100644 --- a/src/storage/tx/ob_tx_data_functor.cpp +++ b/src/storage/tx/ob_tx_data_functor.cpp @@ -405,7 +405,8 @@ int LockForReadFunctor::operator()(const ObTxData &tx_data, ObTxCCCtx *tx_cc_ctx } else if (i < 10) { PAUSE(); } else { - ob_usleep((i < MAX_SLEEP_US ? i : MAX_SLEEP_US)); + ob_usleep( + (i < MAX_SLEEP_US ? i : MAX_SLEEP_US)); } if (retry_cnt == MAX_RETRY_CNT) { int tmp_ret = OB_SUCCESS;