Skip to content

Commit

Permalink
fix: Check query_timestamp in case of concurrent delete
Browse files Browse the repository at this point in the history
Related to milvus-io#38961

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
  • Loading branch information
congqixia committed Jan 2, 2025
1 parent aa0a87e commit 96129ee
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions internal/core/src/segcore/DeletedRecord.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class DeletedRecord {
}
for (auto& offset : offsets) {
auto row_id = offset.get();
// if alreay deleted, no need to add new record
// if already deleted, no need to add new record
if (deleted_mask_.size() > row_id && deleted_mask_[row_id]) {
continue;
}
Expand Down Expand Up @@ -195,17 +195,17 @@ class DeletedRecord {

auto it = start_iter;
while (it != accessor.end() && it != end_iter) {
if (it->second < insert_barrier) {
bitset.set(it->second);
// shall check query_timestamp boundary
// since `lower_bound` could return end while other thread insert new records
if (it->first >= query_timestamp) {
break;
}
it++;
}
while (it != accessor.end() && it->first == query_timestamp) {
if (it->second < insert_barrier) {
bitset.set(it->second);
}
it++;
}
// no need to continue if it.first == query_timestamp, since only timestamps before mvcc_ts are needed
}

size_t
Expand Down

0 comments on commit 96129ee

Please sign in to comment.