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


##########
be/src/format_v2/table/lance_reader.cpp:
##########
@@ -1261,6 +1286,7 @@ void LanceTableReader::_close_dataset() {
         _fts_query_context = nullptr;
     }
     if (_dataset != nullptr) {
+        _collect_session_cache_statistics();

Review Comment:
   [P2] Publish Session counters before the final profile is frozen
   
   For a remote Lance scan with concurrent readers and an early `LIMIT`, one 
worker can satisfy the limit while another, whose dataset is already open, is 
still blocked in `lance_scanner_next`. `stop_scanners()` requests stopping 
without joining that worker, which retains its `ScannerDelegate`; dropping the 
local state's delegates therefore does not run this dataset-close collection 
yet. Meanwhile, pipeline task completion calls 
`PipelineFragmentContext::_close_fragment_instance()`, which saves an 
independent `TRuntimeProfileTree` in `QueryContext`. When the worker eventually 
returns and closes its dataset, these counter updates arrive after that final 
copy and never reach the saved profile. The completed query consequently loses 
that reader's observation window, leaving the new miss counters unavailable or 
partial despite successful statistics access. Publish an available snapshot 
before final profile serialization, with synchronization and delta accounting 
so later close does not d
 ouble count, and cover early LIMIT with a second worker held in a native read. 
The current test explicitly closes the reader before inspecting its profile and 
misses this path.



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