[FEATURE] add sleep signal for lock for read

This commit is contained in:
Handora 2024-12-31 15:15:16 +00:00 committed by ob-robot
parent 81d9940599
commit f4072b7bcd
3 changed files with 3 additions and 2 deletions

View File

@ -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)

View File

@ -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;

View File

@ -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<ObWaitEventIds::LOCK_FOR_READ_WAIT>(
(i < MAX_SLEEP_US ? i : MAX_SLEEP_US));
}
if (retry_cnt == MAX_RETRY_CNT) {
int tmp_ret = OB_SUCCESS;