github-actions[bot] commented on code in PR #70859:
URL: https://github.com/apache/doris/pull/70859#discussion_r4661615774


##########
be/src/storage/segment/segment_iterator.cpp:
##########
@@ -447,7 +424,16 @@ Status SegmentIterator::_init_impl(const 
StorageReadOptions& opts) {
     SCOPED_RAW_TIMER(&_opts.stats->segment_iterator_init_timer_ns);
     _inited = true;
     _file_reader = _segment->_file_reader;
-    RETURN_IF_ERROR(_init_query_read_ahead());
+    if (_opts.io_ctx.query_read_ahead != nullptr &&

Review Comment:
   [P2] Recheck the async-write switch when binding each segment
   
   If a cloud scan starts with both read-ahead and 
`enable_async_file_cache_write` enabled, then the operator disables the latter 
before a later segment is opened, this branch still enables read-ahead from the 
query's retained resources. `make_range_cache_writeback()` accepts the 
resulting `SYNC_WRITE` mode, and the config callback leaves already-started 
write managers accepting, so these new segments continue submitting async cache 
writes and hole fills despite the switch being off. Previously 
`_init_query_read_ahead()` rechecked `ColumnReadAheadResources::enabled()` at 
every segment initialization and selected ordinary reads after the toggle. 
Recheck the current BE prerequisite when binding a new segment so operators can 
stop new async work without waiting for a long scan to finish.



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