Skip to content

Commit

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

Signed-off-by: cqy123456 <[email protected]>
  • Loading branch information
cqy123456 committed Oct 16, 2024
1 parent 4d08eec commit d657b06
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(
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_data_base(vecfield_id);
Expand Down

0 comments on commit d657b06

Please sign in to comment.