mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-29 18:38:44 +08:00
fix: bypass growing index if no index meta (#28791)
we shouldn't panic if no index meta, just skip building it fix #28022 Signed-off-by: yah01 <yang.cen@zilliz.com>
This commit is contained in:
parent
43680043e3
commit
d69440524b
@ -11,6 +11,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <optional>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
@ -24,6 +25,7 @@
|
||||
#include "common/Schema.h"
|
||||
#include "common/IndexMeta.h"
|
||||
#include "IndexConfigGenerator.h"
|
||||
#include "log/Log.h"
|
||||
#include "segcore/SegcoreConfig.h"
|
||||
#include "index/VectorIndex.h"
|
||||
|
||||
@ -248,6 +250,12 @@ class IndexingRecord {
|
||||
if (field_meta.get_data_type() == DataType::VECTOR_BINARY) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (index_meta_ == nullptr) {
|
||||
LOG_SEGCORE_INFO_
|
||||
<< "miss index meta for growing interim index";
|
||||
continue;
|
||||
}
|
||||
//Small-Index enabled, create index for vector field only
|
||||
if (index_meta_->GetIndexMaxRowCount() > 0 &&
|
||||
index_meta_->HasFiled(field_id)) {
|
||||
|
@ -125,6 +125,20 @@ TEST(GrowingIndex, Correctness) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(GrowingIndex, MissIndexMeta) {
|
||||
auto schema = std::make_shared<Schema>();
|
||||
auto pk = schema->AddDebugField("pk", DataType::INT64);
|
||||
auto random = schema->AddDebugField("random", DataType::DOUBLE);
|
||||
auto vec = schema->AddDebugField(
|
||||
"embeddings", DataType::VECTOR_FLOAT, 128, knowhere::metric::L2);
|
||||
schema->set_primary_field_id(pk);
|
||||
|
||||
auto& config = SegcoreConfig::default_config();
|
||||
config.set_chunk_rows(1024);
|
||||
config.set_enable_interim_segment_index(true);
|
||||
auto segment = CreateGrowingSegment(schema, nullptr);
|
||||
}
|
||||
|
||||
using Param = const char*;
|
||||
|
||||
class GrowingIndexGetVectorTest : public ::testing::TestWithParam<Param> {
|
||||
|
Loading…
Reference in New Issue
Block a user