diff --git a/src/storage/tx/ob_trans_define_v4.h b/src/storage/tx/ob_trans_define_v4.h index d99001088f..69720c4313 100644 --- a/src/storage/tx/ob_trans_define_v4.h +++ b/src/storage/tx/ob_trans_define_v4.h @@ -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); diff --git a/src/storage/tx/ob_xa_service.cpp b/src/storage/tx/ob_xa_service.cpp index 2408f08a35..c3f911bb6a 100644 --- a/src/storage/tx/ob_xa_service.cpp +++ b/src/storage/tx/ob_xa_service.cpp @@ -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 {