提交 f419c12e 编写于 作者: C chinaxing 提交者: ob-robot

[master][tx-route] mark static changed when tx switch from IDLE to ABORT

上级 9e1730c4
......@@ -672,10 +672,13 @@ class EventTable
EN_FETCH_TABLE_INFO_RPC = 1112,
// END OF STORAGE HA - 1101 - 2000
// Transaction // 2001 - 2100
// Transaction free route
EN_TX_FREE_ROUTE_UPDATE_STATE_ERROR = 1150,
EN_TX_FREE_ROUTE_ENCODE_STATE_ERROR = 1151,
EN_TX_FREE_ROUTE_STATE_SIZE = 1152,
EN_TX_FREE_ROUTE_UPDATE_STATE_ERROR = 2001,
EN_TX_FREE_ROUTE_ENCODE_STATE_ERROR = 2002,
EN_TX_FREE_ROUTE_STATE_SIZE = 2003,
// Transaction common
EN_TX_RESULT_INCOMPLETE = 2011,
EVENT_TABLE_MAX = SIZE_OF_EVENT_TABLE
};
......
......@@ -864,7 +864,7 @@ int ObSqlTransControl::end_stmt(ObExecContext &exec_ctx, const bool rollback)
OX (ObTransDeadlockDetectorAdapter::maintain_deadlock_info_when_end_stmt(exec_ctx, rollback));
auto &tx_result = session->get_trans_result();
if (OB_FAIL(ret)) {
} else if (tx_result.is_incomplete()) {
} else if (OB_E(EventTable::EN_TX_RESULT_INCOMPLETE, session->get_sessid()) tx_result.is_incomplete()) {
if (!rollback) {
LOG_ERROR("trans result incomplete, but rollback not issued");
}
......
......@@ -557,6 +557,10 @@ int ObTransService::abort_tx_(ObTxDesc &tx, const int cause, const bool cleanup)
TRANS_LOG(WARN, "try abort tx which has decided",
K(ret), K(tx), K(cause));
} else {
// TODO: refactor state switch and put this to there
if (ObTxDesc::State::IDLE == tx.state_) {
tx.state_change_flags_.STATIC_CHANGED_ = 1;
}
tx.state_ = ObTxDesc::State::IN_TERMINATE;
tx.abort_cause_ = cause;
abort_participants_(tx);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册