[CP] [3_1_x] fix unsafe access part_ctx member in iter_trans_stat
This commit is contained in:
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user