[FEAT MERGE] Optimize dml performance in multi-local index scenarios

Co-authored-by: Handora <qcdsr970209@gmail.com>
Co-authored-by: Naynahs <cfzy002@126.com>
Co-authored-by: ZenoWang <wzybuaasoft@163.com>
This commit is contained in:
windye
2024-04-16 15:27:19 +00:00
committed by ob-robot
parent 5c28cef93c
commit 7aca4ef065
59 changed files with 696875 additions and 299635 deletions

View File

@ -36,8 +36,6 @@ int MockObAccessService::insert_rows(
int64_t &affected_rows)
{
int ret = OB_SUCCESS;
ObStoreCtxGuard ctx_guard;
ObLSHandle handle;
ObTabletHandle tablet_handle;
if (OB_UNLIKELY(!ls_id.is_valid())
@ -59,11 +57,11 @@ int MockObAccessService::insert_rows(
dml_param.timeout_,
tx_desc,
tablet_handle,
ctx_guard))) {
*dml_param.store_ctx_guard_))) {
LOG_WARN("fail to check query allowed", K(ret), K(ls_id), K(tablet_id));
} else {
ret = tablet_service_->insert_rows(tablet_handle,
ctx_guard.get_store_ctx(),
dml_param.store_ctx_guard_->get_store_ctx(),
dml_param,
column_ids,
row_iter,

View File

@ -151,6 +151,10 @@ ObTxNode::ObTxNode(const int64_t ls_id,
&schema_service_,
&server_tracer_));
tenant_.set(&txs_);
OZ(fake_opt_stat_mgr_.init(tenant_id_));
tenant_.set(&fake_opt_stat_mgr_);
OZ(fake_lock_wait_mgr_.init());
tenant_.set(&fake_lock_wait_mgr_);
OZ (create_memtable_(100000, memtable_));
{
ObColDesc col_desc;
@ -662,7 +666,7 @@ int ObTxNode::write(ObTxDesc &tx,
param.read_info_ = &read_info;
context.init(query_flag, write_store_ctx, allocator, trans_version_range);
OZ(memtable_->set(param, context, columns_, row, encrypt_meta));
OZ(memtable_->set(param, context, columns_, row, encrypt_meta, false));
OZ(txs_.revert_store_ctx(write_store_ctx));
delete iter;
return ret;
@ -700,7 +704,7 @@ int ObTxNode::write_one_row(ObStoreCtx& write_store_ctx, const int64_t key, cons
read_info.init(allocator, 2, 1, false, columns_, nullptr/*storage_cols_index*/);
ObStoreRow row;
ObObj cols[2] = {ObObj(key), ObObj(value)};
row.flag_ = blocksstable::ObDmlFlag::DF_INSERT;
row.flag_ = blocksstable::ObDmlFlag::DF_UPDATE;
row.row_val_.cells_ = cols;
row.row_val_.count_ = 2;
@ -723,7 +727,7 @@ int ObTxNode::write_one_row(ObStoreCtx& write_store_ctx, const int64_t key, cons
OZ(context.init(query_flag, write_store_ctx, allocator, trans_version_range));
OZ(memtable_->set(param, context, columns_, row, encrypt_meta));
OZ(memtable_->set(param, context, columns_, row, encrypt_meta, false));
return ret;
}

View File

@ -35,6 +35,8 @@
#include "../mock_utils/basic_fake_define.h"
#include "../mock_utils/ob_fake_tx_rpc.h"
#include "share/allocator/ob_shared_memory_allocator_mgr.h"
#include "share/stat/ob_opt_stat_monitor_manager.h"
#include "storage/memtable/ob_lock_wait_mgr.h"
namespace oceanbase {
using namespace transaction;
@ -305,6 +307,8 @@ public:
ObTxNodeRole role_;
ObFakeTxLogAdapter* fake_tx_log_adapter_;
ObTabletMemtableMgr fake_memtable_mgr_;
ObOptStatMonitorManager fake_opt_stat_mgr_;
ObLockWaitMgr fake_lock_wait_mgr_;
storage::ObLS mock_ls_; // TODO mock required member on LS
common::hash::ObHashSet<int16_t> drop_msg_type_set_;
ObLSMap fake_ls_map_;