mrhhsg commented on code in PR #68125:
URL: https://github.com/apache/doris/pull/68125#discussion_r4301245456


##########
be/src/storage/segment/segment_iterator.cpp:
##########
@@ -2057,6 +2060,55 @@ Status SegmentIterator::_init_index_iterators() {
     return Status::OK();
 }
 
+Status SegmentIterator::_drop_placeholder_hidden_column_index(ColumnId cid) {
+    DCHECK(_index_iterators[cid] != nullptr);
+    const auto& column = *_schema->column(cid);
+    if 
(!is_load_placeholder_hidden_column(get_read_time_hidden_column_type(column))) {
+        return Status::OK();
+    }
+    // Index queries take their options from the query's RuntimeState (see
+    // InvertedIndexReader::handle_searcher_cache); compaction, schema change 
and index builds read
+    // without one and evaluate no index.
+    if (_opts.runtime_state == nullptr) {

Review Comment:
   Fixed in 691c951e2604ced3893f1c396c7ea74b78563985. 
`_drop_placeholder_hidden_column_index` now also returns before the probe when 
the query sets `enable_inverted_index_query=false`, so initialization no longer 
runs the `= 0` index query for a scan that never consumes the iterator. Added 
`RangeVersionSkipsPlaceholderProbeWhenIndexQueriesDisabled`: a debug point 
turns any index query into a downgrade, and the case asserts 
`inverted_index_downgrade_count == 0` with the option disabled; it fails 
without the fix. The same commit also drops the iterator when the probe itself 
downgrades, which covers the damaged-leaf case from the review body.



-- 
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]

Reply via email to