[VectorIndex] fix deserialize when get large vector data
This commit is contained in:
parent
569304f966
commit
ca48ae8cdb
@ -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)) {
|
||||
|
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user