Skip to content

Commit 6345e2a

Browse files
hnwyllmmobdevJLY2015
authored
[CP] [CP] [vector index] fix load follower memory
Co-authored-by: obdev <obdev@oceanbase.com> Co-authored-by: JLY2015 <1623359870@qq.com>
1 parent 3627a34 commit 6345e2a

2 files changed

Lines changed: 8 additions & 11 deletions

File tree

src/share/vector_index/ob_plugin_vector_index_service.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ int ObPluginVectorIndexMgr::get_adapter_inst_by_ctx(ObVectorIndexAcquireCtx &ctx
542542
vec_index_param,
543543
dim,
544544
allocator))) {
545-
LOG_WARN("failed to get vector index adapter", K(ctx.embedded_tablet_id_), KR(ret));
545+
LOG_WARN("failed to get vector index adapter", K(ctx.embedded_tablet_id_), KR(ret));
546546
} else if (FALSE_IT(adapter = candidate.embedded_adatper_guard_.get_adatper())) {
547547
} else if (adapter->get_create_type() == CreateTypeFullPartial
548548
|| adapter->get_create_type() == CreateTypeComplete) {
@@ -1041,7 +1041,6 @@ void ObPluginVectorIndexService::destroy()
10411041
DESTROY_CONTEXT(memory_context_);
10421042
memory_context_ = nullptr;
10431043
}
1044-
alloc_.reset();
10451044

10461045
// destroy vec async task
10471046
if (OB_NOT_NULL(tenant_vec_async_task_sched_)) {
@@ -1081,8 +1080,7 @@ int ObPluginVectorIndexService::init(const uint64_t tenant_id,
10811080
"VecIdxLSMgr",
10821081
tenant_id))) {
10831082
LOG_WARN("create ls mgr ", KR(ret), K(tenant_id));
1084-
} else if (FALSE_IT(alloc_.set_tenant_id(tenant_id))) {
1085-
} else if (OB_FAIL(allocator_.init(&alloc_, OB_MALLOC_MIDDLE_BLOCK_SIZE, mem_attr))) {
1083+
} else if (OB_FAIL(allocator_.init(nullptr, OB_MALLOC_MIDDLE_BLOCK_SIZE, mem_attr))) {
10861084
LOG_WARN("ObTenantSrs allocator init failed.", K(ret));
10871085
} else {
10881086
ObSharedMemAllocMgr *shared_mem_mgr = MTL(ObSharedMemAllocMgr*);

src/share/vector_index/ob_plugin_vector_index_service.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,13 @@ class ObVectorIndexAdapterCandiate final
9696
struct ObAdapterMapKeyValue
9797
{
9898
public:
99-
ObAdapterMapKeyValue(ObTabletID tablet_id, ObPluginVectorIndexAdaptor *adapter)
100-
: tablet_id_(tablet_id),
101-
adapter_(adapter)
99+
ObAdapterMapKeyValue(ObTabletID tablet_id, ObPluginVectorIndexAdaptor *adapter)
100+
: tablet_id_(tablet_id),
101+
adapter_(adapter)
102102
{}
103-
ObAdapterMapKeyValue()
104-
: tablet_id_(),
105-
adapter_(nullptr)
103+
ObAdapterMapKeyValue()
104+
: tablet_id_(),
105+
adapter_(nullptr)
106106
{}
107107
TO_STRING_KV(K_(tablet_id), K_(adapter));
108108

@@ -483,7 +483,6 @@ class ObPluginVectorIndexService : public logservice::ObIReplaySubHandler,
483483
storage::ObLSService *ls_service_;
484484
common::ObMySQLProxy *sql_proxy_;
485485
ObFIFOAllocator allocator_;
486-
common::ObArenaAllocator alloc_;
487486
// do not use this memory context directly
488487
// use wrapped memory context in ob_tenant_vector_allocator.h and init by this memory context
489488
lib::MemoryContext memory_context_;

0 commit comments

Comments
 (0)