提交 93be552c 编写于 作者: G gl0 提交者: LINGuanRen

Fix bug in lock_for_read() of ObPartTransCtx

上级 a10b882d
......@@ -11091,13 +11091,14 @@ int ObPartTransCtx::lock_for_read(
ObTransStatusInfo trans_info;
const int64_t MAX_SLEEP_US = 1000;
const int64_t lock_wait_start_ts = ObTimeUtility::current_time();
memtable::ObMemtableCtx &read_ctx = lock_for_read_arg.read_ctx_;
for (int32_t i = 0; OB_ERR_SHARED_LOCK_CONFLICT == ret; i++) {
// leave this check here to make sure no lock is held
int64_t abs_stmt_timeout =
mt_ctx_.get_trx_lock_timeout() < 0
? mt_ctx_.get_abs_expired_time()
: MIN(lock_wait_start_ts + mt_ctx_.get_trx_lock_timeout(), mt_ctx_.get_abs_expired_time());
read_ctx.get_trx_lock_timeout() < 0
? read_ctx.get_abs_expired_time()
: MIN(lock_wait_start_ts + read_ctx.get_trx_lock_timeout(), read_ctx.get_abs_expired_time());
if (OB_FAIL(get_trans_state_and_version_without_lock(trans_info))) {
TRANS_LOG(WARN, "failed to get trans table status", K(ret));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册