mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
Fix lost disk index data (#19636)
Signed-off-by: xige-16 <xi.ge@zilliz.com> Signed-off-by: xige-16 <xi.ge@zilliz.com>
This commit is contained in:
parent
f98dbcf5be
commit
49daee2e17
@ -52,7 +52,8 @@ VectorDiskAnnIndex<T>::Load(const BinarySet& binary_set /* not used */, const Co
|
||||
auto index_files = GetValueFromConfig<std::vector<std::string>>(config, "index_files");
|
||||
AssertInfo(index_files.has_value(), "index file paths is empty when load disk ann index data");
|
||||
file_manager_->CacheIndexToDisk(index_files.value());
|
||||
index_->Prepare(cfg);
|
||||
auto ok = index_->Prepare(cfg);
|
||||
AssertInfo(ok, "load disk index failed");
|
||||
SetDim(index_->Dim());
|
||||
}
|
||||
|
||||
|
||||
@ -93,7 +93,7 @@ DiskFileManagerImpl::AddFile(const std::string& file) noexcept {
|
||||
// Split local data to multi part with specified size
|
||||
int slice_num = 0;
|
||||
auto remotePrefix = GetRemoteIndexObjectPrefix();
|
||||
for (int offset = 0; offset < fileSize; slice_num++) {
|
||||
for (int64_t offset = 0; offset < fileSize; slice_num++) {
|
||||
auto batch_size = std::min(milvus::config::KnowhereGetIndexSliceSize() << 20, int64_t(fileSize) - offset);
|
||||
|
||||
auto fieldData = std::make_shared<FieldData>(buf.get() + offset, batch_size);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user