[4.1][tx-route] fix tx abort miss return part state

This commit is contained in:
chinaxing
2023-04-04 08:44:08 +00:00
committed by ob-robot
parent d2f227903e
commit 5f602ed6c4
2 changed files with 5 additions and 2 deletions

View File

@ -164,6 +164,9 @@ int ObMPUtils::sync_session_info(sql::ObSQLSessionInfo &sess, const common::ObSt
succ_info_types.add_member(info_type); succ_info_types.add_member(info_type);
LOG_DEBUG("sync-session-info", K(info_type), K(info_len)); LOG_DEBUG("sync-session-info", K(info_type), K(info_len));
} }
if (OB_FAIL(ret)) {
sess.post_sync_session_info();
}
} }
return ret; return ret;

View File

@ -558,9 +558,9 @@ int ObTransService::abort_tx_(ObTxDesc &tx, const int cause, const bool cleanup)
TRANS_LOG(WARN, "try abort tx which has decided", TRANS_LOG(WARN, "try abort tx which has decided",
K(ret), K(tx), K(cause)); K(ret), K(tx), K(cause));
} else { } else {
// TODO: refactor state switch and put this to there
if (ObTxDesc::State::IDLE == tx.state_) { if (ObTxDesc::State::IDLE == tx.state_) {
tx.state_change_flags_.STATIC_CHANGED_ = 1; // for tx free route, when switch from idle to abort, same as tx actived
tx.state_change_flags_.mark_all();
} }
tx.state_ = ObTxDesc::State::IN_TERMINATE; tx.state_ = ObTxDesc::State::IN_TERMINATE;
tx.abort_cause_ = cause; tx.abort_cause_ = cause;