[master] fix Txdesc.xa_start_addr when xa restart on orignal node

This commit is contained in:
chinaxing
2023-02-24 14:31:33 +00:00
committed by ob-robot
parent dffd167469
commit 24580ece3f
2 changed files with 5 additions and 1 deletions

View File

@ -592,6 +592,7 @@ public:
const ObXATransID &get_xid() const { return xid_; }
bool is_xa_trans() const { return !xid_.empty(); }
bool is_xa_tightly_couple() const { return xa_tightly_couple_; }
void set_xa_start_addr(common::ObAddr &addr) { xa_start_addr_ = addr; }
common::ObAddr xa_start_addr() const { return xa_start_addr_; }
void reset_for_xa() { xid_.reset(); xa_ctx_ = NULL; }
int trans_deep_copy(const ObTxDesc &x);

View File

@ -1005,7 +1005,10 @@ int ObXAService::xa_start(const ObXATransID &xid,
ret = OB_TRANS_XA_INVAL;
TRANS_LOG(WARN, "invalid flags for xa start", K(ret), K(xid), K(flags));
}
// set xa_start_addr for txn-free-route
if (OB_SUCC(ret) && OB_NOT_NULL(tx_desc)) {
tx_desc->set_xa_start_addr(GCONF.self_addr_);
}
if (OB_FAIL(ret)) {
TRANS_LOG(WARN, "xa start failed", K(ret), K(xid), K(flags), K(timeout_seconds));
} else {