fix ObTxExecResult memory inflation when registering mds

This commit is contained in:
obdev
2023-05-17 10:11:17 +00:00
committed by ob-robot
parent 1cfeb70b31
commit b3710455bf
4 changed files with 13 additions and 6 deletions

View File

@ -1107,10 +1107,11 @@ ObString ObTxReadSnapshot::get_source_name() const
}
ObTxExecResult::ObTxExecResult()
: incomplete_(false),
touched_ls_list_(),
parts_(),
cflict_txs_()
: allocator_("TxExecResult", MTL_ID()),
incomplete_(false),
touched_ls_list_(OB_MALLOC_NORMAL_BLOCK_SIZE, allocator_),
parts_(OB_MALLOC_NORMAL_BLOCK_SIZE, allocator_),
cflict_txs_(OB_MALLOC_NORMAL_BLOCK_SIZE, allocator_)
{}
ObTxExecResult::~ObTxExecResult()
@ -1124,6 +1125,7 @@ void ObTxExecResult::reset()
touched_ls_list_.reset();
parts_.reset();
cflict_txs_.reset();
allocator_.reset();
}
int ObTxExecResult::add_touched_ls(const share::ObLSID ls)

View File

@ -300,6 +300,7 @@ class ObTxExecResult
friend class ObTransService;
friend class ObTxDesc;
OB_UNIS_VERSION(1);
TransModulePageAllocator allocator_;
bool incomplete_; // TODO: (yunxing.cyx) remove, required before sql use new API
share::ObLSArray touched_ls_list_;
ObTxPartList parts_;

View File

@ -99,7 +99,9 @@ class ObPartTransCtx : public ObTransCtx,
public:
ObPartTransCtx()
: ObTransCtx("participant", ObTransCtxType::PARTICIPANT), ObTsCbTask(),
ObTxCycleTwoPhaseCommitter(), is_inited_(false), mt_ctx_(), exec_info_(reserve_allocator_),
ObTxCycleTwoPhaseCommitter(),
is_inited_(false), mt_ctx_(), reserve_allocator_("PartCtx", MTL_ID()),
exec_info_(reserve_allocator_),
mds_cache_(reserve_allocator_),
role_state_(TxCtxRoleState::FOLLOWER),
coord_prepare_info_arr_(OB_MALLOC_NORMAL_BLOCK_SIZE,
@ -781,6 +783,7 @@ private:
// data sequence no of first access
int64_t first_scn_;
private:
TransModulePageAllocator reserve_allocator_;
// ========================================================
// newly added for 4.0
share::ObLSID ls_id_;
@ -841,7 +844,6 @@ private:
const ObTxMsg * msg_2pc_cache_;
share::SCN max_2pc_commit_scn_;
ObLSLogInfoArray coord_prepare_info_arr_;
TransModulePageAllocator reserve_allocator_;
// tmp scheduler addr is used to post response for the second phase of xa commit/rollback
common::ObAddr tmp_scheduler_;
// for standby

View File

@ -737,6 +737,8 @@ int ObTransService::register_mds_into_tx(ObTxDesc &tx_desc,
} else {
time_guard.click("start register");
do {
result.reset();
tx_result.reset();
if (OB_NOT_MASTER == ret) {
ob_usleep(RETRY_INTERVAL);
retry_cnt += 1;