[master] fix multi-stmt txn-free-route
This commit is contained in:
@ -336,6 +336,9 @@ int ObMPQuery::process()
|
||||
if (i > 0) {
|
||||
session.get_raw_audit_record().exec_timestamp_.multistmt_start_ts_
|
||||
= ObTimeUtility::current_time();
|
||||
// before handle multi-stmt's followers, re-calc the txn_free_route's baseline
|
||||
// in order to capture accurate state changed by current stmt
|
||||
session.prep_txn_free_route_baseline();
|
||||
}
|
||||
need_disconnect = true;
|
||||
//FIXME qianfu NG_TRACE_EXT(set_disconnect, OB_ID(disconnect), true, OB_ID(pos), "multi stmt begin");
|
||||
|
||||
@ -2437,15 +2437,25 @@ int ObSQLSessionInfo::on_user_disconnect()
|
||||
return ret;
|
||||
}
|
||||
|
||||
// prepare baseline for the following `calc_txn_free_route` to get the diff
|
||||
void ObSQLSessionInfo::prep_txn_free_route_baseline(bool reset_audit)
|
||||
{
|
||||
#define RESET_TXN_STATE_ENCODER_CHANGED_(x) txn_##x##_info_encoder_.is_changed_ = false
|
||||
#define RESET_TXN_STATE_ENCODER_CHANGED(x) RESET_TXN_STATE_ENCODER_CHANGED_(x)
|
||||
LST_DO(RESET_TXN_STATE_ENCODER_CHANGED, (;), static, dynamic, participants, extra);
|
||||
#undef RESET_TXN_STATE_ENCODER_CHANGED
|
||||
#undef RESET_TXN_STATE_ENCODER_CHANGED_
|
||||
if (reset_audit) {
|
||||
txn_free_route_ctx_.reset_audit_record();
|
||||
}
|
||||
txn_free_route_ctx_.init_before_handle_request(tx_desc_);
|
||||
}
|
||||
|
||||
void ObSQLSessionInfo::post_sync_session_info()
|
||||
{
|
||||
if (!get_is_in_retry()) {
|
||||
#define RESET_TXN_STATE_ENCODER_CHANGED_(x) txn_##x##_info_encoder_.is_changed_ = false
|
||||
#define RESET_TXN_STATE_ENCODER_CHANGED(x) RESET_TXN_STATE_ENCODER_CHANGED_(x)
|
||||
LST_DO(RESET_TXN_STATE_ENCODER_CHANGED, (;), static, dynamic, participants, extra);
|
||||
#undef RESET_TXN_STATE_ENCODER_CHANGED
|
||||
#undef RESET_TXN_STATE_ENCODER_CHANGED_
|
||||
txn_free_route_ctx_.init_before_handle_request(tx_desc_);
|
||||
// preapre baseline for the following executing stmt/cmd
|
||||
prep_txn_free_route_baseline(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1186,6 +1186,7 @@ private:
|
||||
ObTxnExtraInfoEncoder txn_extra_info_encoder_;
|
||||
public:
|
||||
void post_sync_session_info();
|
||||
void prep_txn_free_route_baseline(bool reset_audit = true);
|
||||
void set_txn_free_route(bool txn_free_route);
|
||||
int calc_txn_free_route();
|
||||
bool can_txn_free_route() const;
|
||||
|
||||
Reference in New Issue
Block a user