diff --git a/src/share/vector_index/ob_plugin_vector_index_serialize.cpp b/src/share/vector_index/ob_plugin_vector_index_serialize.cpp index 37b1e694a..f11df503d 100644 --- a/src/share/vector_index/ob_plugin_vector_index_serialize.cpp +++ b/src/share/vector_index/ob_plugin_vector_index_serialize.cpp @@ -261,6 +261,7 @@ int ObHNSWDeserializeCallback::operator()(char*& data, const int64_t data_size, str_iter->~ObTextStringIter(); alloactor->free(str_iter); str_iter = nullptr; + alloactor->reuse(); } else { ret = (str_iter->get_inner_ret() != OB_SUCCESS) ? str_iter->get_inner_ret() : OB_INVALID_DATA; @@ -269,6 +270,7 @@ int ObHNSWDeserializeCallback::operator()(char*& data, const int64_t data_size, str_iter->~ObTextStringIter(); alloactor->free(str_iter); str_iter = nullptr; + alloactor->reuse(); } } if (OB_SUCC(ret) && OB_ISNULL(str_iter)) { diff --git a/src/share/vector_index/ob_plugin_vector_index_utils.cpp b/src/share/vector_index/ob_plugin_vector_index_utils.cpp index 3700a8b04..08ed976dd 100644 --- a/src/share/vector_index/ob_plugin_vector_index_utils.cpp +++ b/src/share/vector_index/ob_plugin_vector_index_utils.cpp @@ -465,14 +465,15 @@ int ObPluginVectorIndexUtils::try_sync_snapshot_memdata(ObLSID &ls_id, } else if (OB_FAIL(adapter->try_init_mem_data(VIRT_SNAP))) { LOG_WARN("try init snap mem data failed.", K(ret)); } else { + ObArenaAllocator tmp_allocator("VectorAdaptor", OB_MALLOC_NORMAL_BLOCK_SIZE, MTL_ID()); ObHNSWDeserializeCallback::CbParam param; param.iter_ = snapshot_idx_iter; - param.allocator_ = &allocator; + param.allocator_ = &tmp_allocator; ObHNSWDeserializeCallback callback; ObIStreamBuf::Callback cb = callback; // ToDo: concurrency with weakread - ObVectorIndexSerializer index_seri(allocator); + ObVectorIndexSerializer index_seri(tmp_allocator); ObVectorIndexMemData *snap_memdata = adapter->get_snap_data_(); if (OB_FAIL(adapter->try_init_mem_data(VIRT_SNAP))) { LOG_WARN("failed to init snapshot index.", K(ret));