提交 e3dd01b9 编写于 作者: Z zh0 提交者: wangzelin.wzl

fix local trans core dump

上级 74d02366
......@@ -278,11 +278,6 @@ void ObPartTransCtx::destroy()
coord_ctx_ = NULL;
}
REC_TRANS_TRACE_EXT(tlog_, destroy, OB_ID(arg1), (int64_t)(&submit_log_cb_));
// [DEBUG_ONLY] print the trace and call stack if the clog is invoking the
// txn callback during destroying the participant context
if (submit_log_cb_.is_callbacking()) {
TRANS_LOG(ERROR, "some BUG may happen !!!", K(lbt()), K(*this), K_(trans_id));
}
if (mt_ctx_.get_ref() != 0) {
TRANS_LOG(ERROR, "memtable_ctx ref not match!!!", K(mt_ctx_.get_ref()), K(*this), K(mt_ctx_), K(&mt_ctx_));
}
......@@ -9050,7 +9045,7 @@ int ObPartTransCtx::on_clear_(const bool need_response)
TRANS_LOG(WARN, "submit 2pc commit clear response error", "ret", tmp_ret, "context", *this);
}
} else if (enable_new_1pc_) {
if (NULL != coord_ctx_) {
if (NULL != coord_ctx_ && !submit_log_cb_.is_commit_log_callbacking()) {
trans_service_->get_coord_trans_ctx_mgr().revert_trans_ctx(coord_ctx_);
coord_ctx_ = NULL;
}
......
......@@ -58,7 +58,7 @@ void ObTransSubmitLogCb::reset()
submit_timestamp_ = 0;
ctx_ = NULL;
have_prev_trans_ = false;
is_callbacking_ = false;
is_commit_log_callbacking_ = false;
}
int ObTransSubmitLogCb::set_log_type(const int64_t log_type)
......@@ -152,7 +152,6 @@ int ObTransSubmitLogCb::on_success(const ObPartitionKey& partition_key, const cl
if (OB_FAIL(part_ctx->get_partition_mgr()->acquire_ctx_ref(trans_id))) {
TRANS_LOG(WARN, "get transaction context from hashmap error", K(ret), K(trans_id));
} else {
is_callbacking_ = true;
get_ctx = ObTimeUtility::fast_current_time();
// batch_commit don't support transaction dependency
const bool batch_commit = (have_prev_trans_ ? false : batch_committed);
......@@ -185,7 +184,9 @@ int ObTransSubmitLogCb::on_success(const ObPartitionKey& partition_key, const cl
}
}
}
// need acquire ref before callback
if (OB_LOG_TRANS_COMMIT == log_type && part_ctx->is_enable_new_1pc()) {
is_commit_log_callbacking_ = true;
}
if (part_ctx->need_to_post_redo_sync_task(log_type)) {
// duplicated table need all lease avaiable replica sync and replay log
if (OB_FAIL(part_ctx->retry_redo_sync_task(log_id, log_type, timestamp, true))) {
......@@ -197,11 +198,11 @@ int ObTransSubmitLogCb::on_success(const ObPartitionKey& partition_key, const cl
if (OB_SUCCESS != (tmp_ret = part_ctx->handle_2pc_local_msg_response(partition, trans_id, log_type))) {
TRANS_LOG(WARN, "handle 2pc local msg response error", K(tmp_ret), K(partition), K(trans_id), K(log_type));
}
is_commit_log_callbacking_ = false;
} else {
// do nothing
}
callback = ObTimeUtility::fast_current_time();
is_callbacking_ = false;
if (OB_SUCCESS != (tmp_ret = part_ctx->get_partition_mgr()->release_ctx_ref(part_ctx))) {
TRANS_LOG(WARN, "revert transaction context error", "ret", tmp_ret, K(partition), K(trans_id));
ret = tmp_ret;
......
......@@ -92,9 +92,9 @@ public:
int on_submit_log_success(
const bool with_need_update_version, const uint64_t cur_log_id, const int64_t cur_log_timestamp);
int on_submit_log_fail(const int retcode);
bool is_callbacking() const
bool is_commit_log_callbacking() const
{
return is_callbacking_;
return is_commit_log_callbacking_;
}
private:
......@@ -115,7 +115,7 @@ private:
int64_t submit_timestamp_;
ObTransCtx* ctx_;
bool have_prev_trans_;
bool is_callbacking_;
bool is_commit_log_callbacking_;
};
} // namespace transaction
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册