diff --git a/src/storage/transaction/ob_trans_part_ctx.cpp b/src/storage/transaction/ob_trans_part_ctx.cpp index fca09b279fb8ea6cf7b85a3851843e90940c7253..aeb2a52bb4cc91e0d6ba824ffd5edb1ca534848c 100644 --- a/src/storage/transaction/ob_trans_part_ctx.cpp +++ b/src/storage/transaction/ob_trans_part_ctx.cpp @@ -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));