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

This commit is contained in:
obdev
2022-08-08 20:34:48 +08:00
committed by wangzelin.wzl
parent af7a161cd8
commit a69e1e30df
3 changed files with 11 additions and 1 deletions

View File

@ -4633,5 +4633,14 @@ int ObExecEnv::store(ObBasicSessionInfo& session)
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 oceanbase

View File

@ -1371,6 +1371,7 @@ public:
{
return trans_desc_.get_standalone_stmt_desc().is_valid();
}
bool is_xa_trans();
bool is_server_status_in_transaction() const;

View File

@ -637,7 +637,7 @@ bool ObSQLSessionMgr::CheckSessionFunctor::operator()(sql::ObSQLSessionMgr::Key
// kill transaction which is idle more than configuration 'ob_trx_idle_timeout'
if (OB_FAIL(sess_info->is_trx_idle_timeout(is_timeout))) {
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_));
int tmp_ret;
if (OB_SUCCESS != (tmp_ret = sess_mgr_->kill_active_trx(sess_info))) {