fix: fix query incorrect in case of concurrent delete (#38991) (#39054)

pr: #38991

Signed-off-by: luzhang <luzhang@zilliz.com>
Co-authored-by: luzhang <luzhang@zilliz.com>
pull/39091/head
zhagnlu 2025-01-08 17:48:56 +08:00 committed by GitHub
parent 76c66f07be
commit aecf04e369
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 0 deletions

View File

@ -195,6 +195,19 @@ class DeletedRecord {
accessor.lower_bound(std::make_pair(query_timestamp, 0));
auto it = start_iter;
// when end_iter point to skiplist end, concurrent delete may append new value
// after lower_bound() called, so end_iter is not logical valid.
if (end_iter == accessor.end()) {
while (it != accessor.end() && it->first <= query_timestamp) {
if (it->second < insert_barrier) {
bitset.set(it->second);
}
it++;
}
return;
}
while (it != accessor.end() && it != end_iter) {
if (it->second < insert_barrier) {
bitset.set(it->second);