[master][tx-route] add sanitycheck : the tx static state must from other node

This commit is contained in:
chinaxing
2023-03-07 11:46:04 +00:00
committed by ob-robot
parent 51134ae43e
commit 17a3993297
2 changed files with 7 additions and 1 deletions

View File

@ -465,7 +465,7 @@ int ObMPPacketSender::send_error_packet(int err,
if (OB_FAIL(send_ok_packet(*session, ok_param, &epacket))) {
LOG_WARN("failed to send ok packet", K(ok_param), K(ret));
}
LOG_INFO("dump txn free route audit_record", "value", session->get_txn_free_route_flag());
LOG_INFO("dump txn free route audit_record", "value", session->get_txn_free_route_flag(), K(session->get_sessid()), K(session->get_proxy_sessid()));
}
} else { // just a basic ok packet contain nothing
OMPKOK okp;

View File

@ -323,6 +323,12 @@ int ObTransService::txn_free_route__update_static_state(const uint32_t session_i
if (OB_FAIL(tx->decode_static_state(buf, len, pos))) {
// unretryable
TRANS_LOG(WARN, "decode static state failed", K(ret));
} else if (tx->addr_ == self_ && tx->sess_id_ != session_id && !tx->is_xa_trans()) {
// receive static state which was born in this node, and its session is not current session
// this can only happened for XA which xa_start on remote
ret = OB_ERR_UNEXPECTED;
TRANS_LOG(ERROR, "receive tx static-state born in this node of another session", K(ret),
K(tx->sess_id_), K(session_id), KPC(tx));
} else if (need_add_tx && !tx->is_xa_trans()
&& OB_FAIL(tx_desc_mgr_.add_with_txid(tx->tx_id_, *tx))) {
// unretryable