Add adjustments to virtual table | views about trans scheduler

This commit is contained in:
obdev
2023-04-03 22:12:53 +00:00
committed by ob-robot
parent 5b086ee2da
commit bd6cf4e99d
11 changed files with 280 additions and 97 deletions

View File

@ -155,7 +155,9 @@ DEF_TO_STRING(ObTxSavePoint)
}
J_COMMA();
J_KV(K_(scn));
J_COMMA();
J_KV(K_(session_id));
J_COMMA();
J_KV(K_(user_create));
J_OBJ_END();
return pos;

View File

@ -1230,13 +1230,12 @@ public:
{
int tmp_ret = common::OB_SUCCESS;
bool bool_ret = false;
ObTransID tx_id;
if (OB_ISNULL(tx_desc)) {
tmp_ret = OB_INVALID_ARGUMENT;
TRANS_LOG_RET(WARN, tmp_ret, "invalid argument tx_desc", KP(tx_desc));
} else {
tx_id = tx_desc->tx_id_;
ObTransID &tx_id = tx_desc->tx_id_;
if (!tx_id.is_valid()) {
tmp_ret = OB_INVALID_ARGUMENT;
TRANS_LOG_RET(WARN, tmp_ret, "invalid argument tx_id", K(tx_id), KP(tx_desc));
@ -1261,13 +1260,15 @@ public:
tx_desc->coord_id_,
copy_parts,
tx_desc->isolation_,
tx_desc->snapshot_version_.get_val_for_tx(true),
tx_desc->snapshot_version_,
tx_desc->access_mode_,
tx_desc->op_sn_,
tx_desc->flags_.v_,
tx_desc->active_ts_,
tx_desc->expire_ts_,
tx_desc->timeout_us_,
tx_desc->ref_,
tx_desc,
copy_savepoints,
tx_desc->abort_cause_,
tx_desc->can_elr_))) {

View File

@ -156,13 +156,15 @@ int ObTxSchedulerStat::init(const uint64_t tenant_id,
const share::ObLSID &coord_id,
const ObTxPartList &parts,
const ObTxIsolationLevel &isolation,
const int64_t snapshot_version,
const share::SCN &snapshot_version,
const ObTxAccessMode &access_mode,
const uint64_t op_sn,
const uint64_t flag,
const int64_t active_ts,
const int64_t expire_ts,
const int64_t timeout_us,
const int32_t ref_cnt,
const void* const tx_desc_addr,
const ObTxSavePointList &savepoints,
const int16_t abort_cause,
const bool can_elr)
@ -193,6 +195,8 @@ int ObTxSchedulerStat::init(const uint64_t tenant_id,
active_ts_ = active_ts;
expire_ts_ = expire_ts;
timeout_us_ = timeout_us;
ref_cnt_ = ref_cnt;
tx_desc_addr_ = tx_desc_addr;
abort_cause_ = abort_cause;
can_elr_ = can_elr;
}
@ -212,13 +216,15 @@ void ObTxSchedulerStat::reset()
coord_id_.reset();
parts_.reset();
isolation_ = ObTxIsolationLevel::INVALID;
snapshot_version_ = -1;
snapshot_version_.reset();
access_mode_ = ObTxAccessMode::INVL;
op_sn_ = -1;
flag_ = 0;
active_ts_ = -1;
expire_ts_ = -1;
timeout_us_ = -1;
ref_cnt_ = -1;
tx_desc_addr_ = (void*)0;
savepoints_.reset();
abort_cause_ = 0;
can_elr_ = false;
@ -247,8 +253,8 @@ int64_t ObTxSchedulerStat::get_parts_str(char* buf, const int64_t buf_len)
int ObTxSchedulerStat::get_valid_savepoints(const ObTxSavePointList &savepoints)
{
int ret = OB_SUCCESS;
for (int i = 0; i < savepoints.count(); i++) {
if (savepoints.at(i).is_savepoint() || savepoints.at(i).is_snapshot()) {
for (int i = 0; OB_SUCC(ret) && i < savepoints.count(); i++) {
if (savepoints.at(i).is_savepoint()) {
if (OB_FAIL(savepoints_.push_back(savepoints.at(i)))) {
TRANS_LOG(WARN, "failed to push into savepoints array", KR(ret));
}

View File

@ -140,13 +140,15 @@ public:
const share::ObLSID &coord_id,
const ObTxPartList &parts,
const ObTxIsolationLevel &isolation,
const int64_t snapshot_version,
const share::SCN &snapshot_version,
const ObTxAccessMode &access_mode,
const uint64_t op_sn,
const uint64_t flag,
const int64_t active_ts,
const int64_t expire_ts,
const int64_t timeout_us,
const int32_t ref_cnt,
const void* const tx_desc_addr,
const ObTxSavePointList &savepoints,
const int16_t abort_cause,
const bool can_elr);
@ -156,7 +158,8 @@ public:
K_(isolation), K_(snapshot_version),
K_(access_mode), K_(op_sn),
K_(flag), K_(active_ts), K_(expire_ts),
K_(timeout_us), K_(savepoints),
K_(timeout_us), K_(ref_cnt),
K_(tx_desc_addr), K_(savepoints),
K_(abort_cause), K_(can_elr));
int64_t get_parts_str(char* buf, const int64_t buf_len);
int get_valid_savepoints(const ObTxSavePointList &savepoints);
@ -173,13 +176,15 @@ public:
share::ObLSID coord_id_;
ObTxPartList parts_;
ObTxIsolationLevel isolation_;
int64_t snapshot_version_;
share::SCN snapshot_version_;
ObTxAccessMode access_mode_;
uint64_t op_sn_;
uint64_t flag_;
int64_t active_ts_;
int64_t expire_ts_;
int64_t timeout_us_;
int32_t ref_cnt_;
const void *tx_desc_addr_;
ObTxSavePointList savepoints_;
int16_t abort_cause_;
bool can_elr_;