[BUG]maintain ls reference for transfer read

This commit is contained in:
Handora
2024-02-09 20:53:34 +00:00
committed by ob-robot
parent 98db9a11be
commit d484d3d370
3 changed files with 11 additions and 5 deletions

View File

@ -169,9 +169,11 @@ public:
write_flag_ = write_flag;
}
void set_src_tx_table_guard(const storage::ObTxTableGuard &tx_table_guard)
void set_src_tx_table_guard(const storage::ObTxTableGuard &tx_table_guard,
storage::ObLSHandle &src_ls_handle)
{
tx_table_guards_.src_tx_table_guard_ = tx_table_guard;
tx_table_guards_.src_ls_handle_ = src_ls_handle;
}
void init_replay(transaction::ObPartTransCtx &tx_ctx,
ObMemtableCtx &mem_ctx,

View File

@ -418,7 +418,7 @@ int ObAccessService::get_source_ls_tx_table_guard_(
LOG_WARN("start request for transfer failed", KR(ret), K(user_data));
} else {
ObStoreCtx &ctx = ctx_guard.get_store_ctx();
ctx.mvcc_acc_ctx_.set_src_tx_table_guard(src_tx_table_guard);
ctx.mvcc_acc_ctx_.set_src_tx_table_guard(src_tx_table_guard, ls_handle);
LOG_DEBUG("succ get src tx table guard", K(ret), K(src_ls->get_ls_id()), K(src_tx_table_guard), K(user_data));
}
}

View File

@ -47,7 +47,8 @@ class ObTxTableGuards
public:
ObTxTableGuards()
: tx_table_guard_(),
src_tx_table_guard_() {}
src_tx_table_guard_(),
src_ls_handle_() {}
~ObTxTableGuards() { reset(); }
@ -55,6 +56,7 @@ public:
{
tx_table_guard_.reset();
src_tx_table_guard_.reset();
src_ls_handle_.reset();
}
void reuse()
@ -149,13 +151,15 @@ public:
bool check_ls_offline();
TO_STRING_KV(K_(tx_table_guard), K_(src_tx_table_guard));
TO_STRING_KV(K_(tx_table_guard), K_(src_tx_table_guard), K_(src_ls_handle));
public:
storage::ObTxTableGuard tx_table_guard_;
// dml executed during transfer, src_tx_table_guard_ will be valid.
// when dml is executing during transfer, src_tx_table_guard_ and
// src_ls_handle_ will be valid.
storage::ObTxTableGuard src_tx_table_guard_;
storage::ObLSHandle src_ls_handle_;
};
} // namespace storage