提交 e2f9e077 编写于 作者: D dimstars 提交者: ob-robot

fix coredump at ObEndTransCallback::callback

上级 8268127e
......@@ -4345,6 +4345,8 @@ int ObBasicSessionInfo::trans_save_session(TransSavedValue& saved_value)
OX(trans_result_.reset());
OX(saved_value.nested_count_ = nested_count_);
OX(nested_count_ = -1);
OX(saved_value.trans_consistency_type_ = trans_consistency_type_);
OX(trans_consistency_type_ = transaction::ObTransConsistencyType::UNKNOWN);
return ret;
}
......@@ -4356,6 +4358,7 @@ int ObBasicSessionInfo::trans_restore_session(TransSavedValue& saved_value)
OX(trans_flags_ = saved_value.trans_flags_);
OZ(trans_desc_.trans_deep_copy(saved_value.trans_desc_));
OZ(base_restore_session(saved_value));
OX(trans_consistency_type_ = saved_value.trans_consistency_type_);
return ret;
}
......
......@@ -378,6 +378,7 @@ public:
trans_flags_.reset();
trans_result_.reset();
nested_count_ = -1;
trans_consistency_type_ = transaction::ObTransConsistencyType::UNKNOWN;
}
public:
......@@ -385,6 +386,7 @@ public:
TransFlags trans_flags_;
TransResult trans_result_;
int64_t nested_count_;
int32_t trans_consistency_type_;
};
public:
......
......@@ -727,6 +727,11 @@ int ObTransService::handle_sp_end_trans_(const bool is_rollback, ObTransDesc& tr
need_rollback = true;
save_ret = OB_TRANS_ROLLBACKED;
callback = &null_cb;
} else if (is_bounded_staleness_read && OB_NOT_NULL(trans_desc.get_part_ctx())) {
TRANS_LOG(ERROR, "transaction is_bounded_staleness_read but part_ctx is not null", K(is_rollback), K(trans_desc));
need_rollback = true;
save_ret = OB_ERR_UNEXPECTED;
callback = &null_cb;
}
TRANS_STAT_COMMIT_ABORT_TRANS_INC(need_rollback, tenant_id);
......@@ -748,19 +753,11 @@ int ObTransService::handle_sp_end_trans_(const bool is_rollback, ObTransDesc& tr
need_convert_to_dist_trans))) {
TRANS_LOG(WARN, "sp commit failed", K(ret), K(stmt_expired_time), K(trans_desc));
if (!need_convert_to_dist_trans) {
if (is_bounded_staleness_read) {
(void)slave_part_trans_ctx_mgr_.revert_trans_ctx(part_ctx);
} else {
(void)part_trans_ctx_mgr_.revert_trans_ctx(part_ctx);
}
}
} else {
if (is_bounded_staleness_read) {
(void)slave_part_trans_ctx_mgr_.revert_trans_ctx(part_ctx);
} else {
(void)part_trans_ctx_mgr_.revert_trans_ctx(part_ctx);
}
}
if (OB_SUCC(ret)) {
ret = save_ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册