[master][tx-route] when act-on-temp dump txdesc and trace

This commit is contained in:
chinaxing
2023-04-13 07:11:42 +00:00
committed by ob-robot
parent 7e1194920a
commit 1d14c2ce7c
3 changed files with 17 additions and 0 deletions

View File

@ -56,6 +56,9 @@
TRANS_LOG(ERROR, "trans act on txn temporary node", KR(ret), \
K(session->get_txn_free_route_ctx()), \
K(session->get_tx_id()), KPC(session)); \
if (session->get_tx_desc()) { \
session->get_tx_desc()->dump_and_print_trace(); \
} \
}
namespace oceanbase

View File

@ -483,6 +483,19 @@ void ObTxDesc::print_trace()
}
}
void ObTxDesc::dump_and_print_trace()
{
int ret = OB_SUCCESS;
if (OB_FAIL(lock_.trylock())) {
TRANS_LOG(WARN, "acquire lock fail", K(ret), KP(this), K(tx_id_));
} else {
share::ObTaskController::get().allow_next_syslog();
TRANS_LOG(INFO, "[tx desc dump]", KPC(this));
print_trace_();
lock_.unlock();
}
}
bool ObTxDesc::in_tx_or_has_extra_state()
{
ObSpinLockGuard guard(lock_);

View File

@ -616,6 +616,7 @@ public:
bool is_in_tx() const { return state_ > State::IDLE; }
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_for_free_route();
const ObTransID &get_tx_id() const { return tx_id_; }