提交 a69e1e30 编写于 作者: O obdev 提交者: wangzelin.wzl

[CP] [xa] [fix] intercept the idle timeout behavior of xa

上级 af7a161c
...@@ -4633,5 +4633,14 @@ int ObExecEnv::store(ObBasicSessionInfo& session) ...@@ -4633,5 +4633,14 @@ int ObExecEnv::store(ObBasicSessionInfo& session)
return ret; return ret;
} }
bool ObBasicSessionInfo::is_xa_trans()
{
int bool_ret = false;
if (trans_desc_.is_valid() && trans_desc_.is_xa_local_trans()) {
bool_ret = true;
}
return bool_ret;
}
} // end of namespace sql } // end of namespace sql
} // end of namespace oceanbase } // end of namespace oceanbase
...@@ -1371,6 +1371,7 @@ public: ...@@ -1371,6 +1371,7 @@ public:
{ {
return trans_desc_.get_standalone_stmt_desc().is_valid(); return trans_desc_.get_standalone_stmt_desc().is_valid();
} }
bool is_xa_trans();
bool is_server_status_in_transaction() const; bool is_server_status_in_transaction() const;
......
...@@ -637,7 +637,7 @@ bool ObSQLSessionMgr::CheckSessionFunctor::operator()(sql::ObSQLSessionMgr::Key ...@@ -637,7 +637,7 @@ bool ObSQLSessionMgr::CheckSessionFunctor::operator()(sql::ObSQLSessionMgr::Key
// kill transaction which is idle more than configuration 'ob_trx_idle_timeout' // kill transaction which is idle more than configuration 'ob_trx_idle_timeout'
if (OB_FAIL(sess_info->is_trx_idle_timeout(is_timeout))) { if (OB_FAIL(sess_info->is_trx_idle_timeout(is_timeout))) {
LOG_WARN("fail to check transaction idle timeout", K(ret)); LOG_WARN("fail to check transaction idle timeout", K(ret));
} else if (true == is_timeout) { } else if (true == is_timeout && !sess_info->is_xa_trans()) {
LOG_INFO("transaction is idle timeout, start to rollback", K(key.version_), K(key.sessid_)); LOG_INFO("transaction is idle timeout, start to rollback", K(key.version_), K(key.sessid_));
int tmp_ret; int tmp_ret;
if (OB_SUCCESS != (tmp_ret = sess_mgr_->kill_active_trx(sess_info))) { if (OB_SUCCESS != (tmp_ret = sess_mgr_->kill_active_trx(sess_info))) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册