Skip to content

Commit

Permalink
fix:[2.4]Chunk Id out of range in vector BF search, after the growing…
Browse files Browse the repository at this point in the history
… index removes the vec chunks.

Signed-off-by: cqy123456 <[email protected]>
  • Loading branch information
cqy123456 committed Oct 16, 2024
1 parent 89f28cf commit ce8135a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions internal/core/src/query/SearchOnGrowing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,20 @@ SearchOnGrowing(const segcore::SegmentGrowingImpl& segment,
FloatSegmentIndexSearch(
segment, info, query_data, num_queries, bitset, search_result);
} else {
std::shared_lock<std::shared_mutex> read_chunk_mutex(
segment.get_chunk_mutex());
// check SyncDataWithIndex() again, in case the vector chunks has been removed.
if (segment.get_indexing_record().SyncDataWithIndex(field.get_id())) {
FloatSegmentIndexSearch(

Check warning on line 101 in internal/core/src/query/SearchOnGrowing.cpp

View check run for this annotation

Codecov / codecov/patch

internal/core/src/query/SearchOnGrowing.cpp#L101

Added line #L101 was not covered by tests
segment, info, query_data, num_queries, bitset, search_result);
}
SubSearchResult final_qr(num_queries, topk, metric_type, round_decimal);
// TODO(SPARSE): see todo in PlanImpl.h::PlaceHolder.
auto dim = field.get_data_type() == DataType::VECTOR_SPARSE_FLOAT
? 0
: field.get_dim();
dataset::SearchDataset search_dataset{
metric_type, num_queries, topk, round_decimal, dim, query_data};
std::shared_lock<std::shared_mutex> read_chunk_mutex(
segment.get_chunk_mutex());
int32_t current_chunk_id = 0;
// step 3: brute force search where small indexing is unavailable
auto vec_ptr = record.get_field_data_base(vecfield_id);
Expand Down

0 comments on commit ce8135a

Please sign in to comment.