add timeguard for replay

This commit is contained in:
obdev
2022-12-27 04:41:49 +00:00
committed by ob-robot
parent 529e541dd6
commit 9f3038df4f
2 changed files with 11 additions and 0 deletions

View File

@ -295,11 +295,14 @@ int ObOBJLock::recover_lock(
ObMalloc &allocator)
{
int ret = OB_SUCCESS;
common::ObTimeGuard timeguard("recover_lock", 10 * 1000);
if (OB_UNLIKELY(!lock_op.is_valid())) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("invalid argument.", K(ret), K(lock_op));
} else if (FALSE_IT(timeguard.click("start"))) {
} else if (OB_LIKELY(!lock_op.need_record_lock_op())) {
RDLockGuard guard(rwlock_);
timeguard.click("rlock");
if (is_deleted_) {
// need retry from upper layer.
ret = OB_EAGAIN;
@ -308,6 +311,7 @@ int ObOBJLock::recover_lock(
}
} else {
WRLockGuard guard(rwlock_);
timeguard.click("wlock");
if (is_deleted_) {
// need retry from upper layer.
ret = OB_EAGAIN;