[CP] [4_2_x] the statistics of rollback times is lost in ac = 1

This commit is contained in:
chinaxing
2024-02-20 05:41:39 +00:00
committed by ob-robot
parent 95525551e8
commit 4367984c08
4 changed files with 21 additions and 3 deletions

View File

@ -332,6 +332,7 @@ public:
const ObField &field,
obmysql::ObMySQLField &mfield);
void set_close_fail_callback(ObFunction<void(const int, int&)> func) { close_fail_cb_ = func; }
void set_will_retry() { will_retry_ = true; }
private:
// types and constants
static const int64_t TRANSACTION_SET_VIOLATION_MAX_RETRY = 3;
@ -349,7 +350,7 @@ private:
bool transaction_set_violation_and_retry(int &err, int64_t &retry);
int init_cmd_exec_context(ObExecContext &exec_ctx);
int on_cmd_execute();
int auto_end_plan_trans(ObPhysicalPlan& plan, int ret, bool &async);
int auto_end_plan_trans(ObPhysicalPlan& plan, int ret, bool is_tx_active, bool &async);
int do_close(int *client_ret = NULL);
void store_affected_rows(ObPhysicalPlanCtx &plan_ctx);
void store_found_rows(ObPhysicalPlanCtx &plan_ctx);
@ -373,7 +374,7 @@ private:
oceanbase::observer::ObReqTimeInfo &req_timeinfo = observer::ObReqTimeInfo::get_thread_local_instance();
req_timeinfo.update_end_time();
}
bool is_will_retry_() const { return will_retry_; }
protected:
// 区分本ResultSet是为User还是Inner SQL服务, 服务于EndTrans异步回调
bool is_user_sql_;
@ -433,6 +434,7 @@ private:
bool is_returning_;
bool is_com_filed_list_; //used to mark COM_FIELD_LIST
bool need_revert_tx_; //dblink
bool will_retry_; // the query will retry, to figure out the final close
common::ObString wild_str_;//uesd to save filed wildcard in COM_FIELD_LIST;
common::ObString ps_sql_; // for sql in pl
bool is_init_;
@ -509,6 +511,7 @@ inline ObResultSet::ObResultSet(ObSQLSessionInfo &session, common::ObIAllocator
is_returning_(false),
is_com_filed_list_(false),
need_revert_tx_(false),
will_retry_(false),
wild_str_(),
ps_sql_(),
is_init_(false),