[CP] [xa] [fix] intercept the idle timeout behavior of xa
This commit is contained in:
@ -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:
|
|||||||
{
|
{
|
||||||
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
|
|||||||
// 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))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user