[CP] tx-rout check idle exit of extra-state only trans

This commit is contained in:
chinaxing 2024-09-20 06:21:26 +00:00 committed by ob-robot
parent 25c9b0f385
commit 8cc362e8f4
3 changed files with 5 additions and 4 deletions

View File

@ -618,7 +618,7 @@ void ObTxDesc::dump_and_print_trace()
}
}
bool ObTxDesc::in_tx_or_has_extra_state()
bool ObTxDesc::in_tx_or_has_extra_state() const
{
ObSpinLockGuard guard(lock_);
return in_tx_or_has_extra_state_();

View File

@ -781,7 +781,7 @@ public:
bool is_tx_active() const { return state_ >= State::ACTIVE && state_ < State::IN_TERMINATE; }
void print_trace();
void dump_and_print_trace();
bool in_tx_or_has_extra_state();
bool in_tx_or_has_extra_state() const;
bool in_tx_for_free_route();
const ObTransID &get_tx_id() const { return tx_id_; }
ObITxCallback *get_end_tx_cb() { return commit_cb_; }

View File

@ -1280,8 +1280,9 @@ int ObTransService::tx_free_route_check_alive(ObTxnFreeRouteCtx &ctx, const ObTx
{
int ret = OB_SUCCESS;
// 1. skip txn born node
// 2. skip txn is idle state
if (ctx.txn_addr_.is_valid() && ctx.txn_addr_ != self_ && tx.is_in_tx()) {
// 2. skip txn is idle state, but with extra info (like serializable snapshot)
if (ctx.txn_addr_.is_valid() && ctx.txn_addr_ != self_
&& tx.get_tx_id().is_valid() && tx.in_tx_or_has_extra_state()) {
common::ObCurTraceId::init(self_);
ObTxFreeRouteCheckAliveMsg m;
m.request_id_ = ctx.get_local_version();