[CP] [4.x][dblink] add defensive measures and fallback for tx free route in dblink trans

This commit is contained in:
jw-guo 2024-03-08 11:26:33 +00:00 committed by ob-robot
parent b886abca51
commit 4fc2582e5e
2 changed files with 11 additions and 0 deletions

View File

@ -173,6 +173,14 @@ void ObSql::stat()
LOG_WARN("only DML stmt or SET command is supported to be executed on txn temporary node", \
KR(ret), K(stmt_type), K(session.get_txn_free_route_ctx()), K(session)); \
} \
ObPhysicalPlan* phy_plan = result.get_physical_plan(); \
if (OB_SUCCESS == ret && NULL != phy_plan) { \
if (phy_plan->has_link_table()) { \
ret = OB_TRANS_FREE_ROUTE_NOT_SUPPORTED; \
LOG_WARN("stmt with dblink can not be executed on txn temporary node", \
KR(ret), K(stmt_type), K(session.get_txn_free_route_ctx()), K(session)); \
} \
} \
} \
}

View File

@ -1100,6 +1100,9 @@ bool ObTransService::need_fallback_(ObTxDesc &tx, int64_t &total_size)
if (tx.with_temporary_table()) {
TRANS_LOG(TRACE, "with tx level temp-table");
fallback = true;
} else if (tx.is_xa_trans() && tx.is_xa_tightly_couple()) {
TRANS_LOG(TRACE, "need fallback for tightly coupled xa trans");
fallback = true;
} else {
total_size = OB_E(EventTable::EN_TX_FREE_ROUTE_STATE_SIZE, tx.tx_id_) tx.estimate_state_size();
if (total_size > MAX_STATE_SIZE) {