提交 e146d574 编写于 作者: C chinaxing 提交者: wangzelin.wzl

[CP] [3_1_x] fix unsafe access part_ctx member in iter_trans_stat

上级 9c6da65e
......@@ -741,6 +741,7 @@ public:
// If the transaction has not completed in 600 seconds, print its trace log
part_ctx->print_trace_log();
}
/* _NOTICE_: must acquire part_ctx's lock when accessing member of imprimitive type */
if (OB_SUCCESS == tmp_ret) {
ObPartitionArray participants_arr(
common::ObModIds::OB_TRANS_PARTITION_ARRAY, common::OB_MALLOC_NORMAL_BLOCK_SIZE);
......
......@@ -12146,7 +12146,13 @@ int64_t ObPartTransCtx::get_part_trans_action() const
if (ObPartTransAction::UNKNOWN == action) {
if (stmt_info_.get_sql_no() > 0) {
action = stmt_info_.is_task_match() ? ObPartTransAction::END_TASK : ObPartTransAction::START_TASK;
int ret = OB_SUCCESS;
if (OB_FAIL(lock_.try_lock())) {
TRANS_LOG(INFO, "lock fail to get part_trans_action", K(ret), K_(trans_id), K_(self), KP(this));
} else {
action = stmt_info_.is_task_match() ? ObPartTransAction::END_TASK : ObPartTransAction::START_TASK;
lock_.unlock();
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册