airborne12 commented on code in PR #67180:
URL: https://github.com/apache/doris/pull/67180#discussion_r4089983919
##########
be/src/storage/segment/segment_iterator.cpp:
##########
@@ -820,6 +807,38 @@ Status
SegmentIterator::_get_row_ranges_by_column_conditions() {
return Status::OK();
}
+ // Apply stable scan restrictions before evaluating inverted-index
expressions so
+ // selective restrictions can also serve as phrase-query candidates. The
candidate
+ // pointer keeps referring to _row_bitmap as later predicates shrink it.
+ auto delete_bitmap_it = _opts.delete_bitmap.find(segment_id());
+ if (delete_bitmap_it != _opts.delete_bitmap.end() &&
delete_bitmap_it->second != nullptr) {
+ size_t pre_size = _row_bitmap.cardinality();
+ _row_bitmap -= *delete_bitmap_it->second;
Review Comment:
Confirmed: `BetaRowsetReader` aggregates deletes through the read version,
while `ConditionCache::CacheKey` has no visibility version. Commit
`daa17874350` disables condition-cache lookup and publication for a segment
with a non-empty delete bitmap. Segments without deletes keep their existing
cache behavior.
The new ASAN test `versioned_deletes_do_not_publish_condition_cache`
constructs the older reader first, empties the newer reader's row bitmap with
deletes, follows the EOF cache-publication condition, and then initializes the
older reader. The older reader misses the cache and retains all 100 rows. The
related SegmentIterator tests pass 21/21, and `./build.sh --be -j 8` passes.
The full PR English and format gates also pass against `master` at
`b515db281e1`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]