This is an automated email from the ASF dual-hosted git repository.

morrysnow pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new cf9a8849499 branch-3.1: [fix](filecache) fix 
BytesScannedFromCache/Local always zero #55929 (#57536)
cf9a8849499 is described below

commit cf9a88494990090b15dd5a16ba70536c1e547452
Author: zhengyu <[email protected]>
AuthorDate: Mon Nov 3 11:33:46 2025 +0800

    branch-3.1: [fix](filecache) fix BytesScannedFromCache/Local always zero 
#55929 (#57536)
    
    picked from #55929
---
 be/src/io/cache/cached_remote_file_reader.cpp | 3 +--
 be/src/vec/exec/scan/new_olap_scanner.cpp     | 3 +++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/be/src/io/cache/cached_remote_file_reader.cpp 
b/be/src/io/cache/cached_remote_file_reader.cpp
index aaa1e5f4feb..baf5a4792ea 100644
--- a/be/src/io/cache/cached_remote_file_reader.cpp
+++ b/be/src/io/cache/cached_remote_file_reader.cpp
@@ -151,6 +151,7 @@ Status CachedRemoteFileReader::read_at_impl(size_t offset, 
Slice result, size_t*
     ReadStatistics stats;
     MonotonicStopWatch read_at_sw;
     read_at_sw.start();
+    stats.bytes_read += bytes_req;
     auto defer_func = [&](int*) {
         if (config::print_stack_when_cache_miss) {
             if (io_ctx->file_cache_stats == nullptr && !stats.hit_cache && 
!io_ctx->is_warmup) {
@@ -174,7 +175,6 @@ Status CachedRemoteFileReader::read_at_impl(size_t offset, 
Slice result, size_t*
         }
     };
     std::unique_ptr<int, decltype(defer_func)> defer((int*)0x01, 
std::move(defer_func));
-    stats.bytes_read += bytes_req;
     if (_is_doris_table && config::enable_read_cache_file_directly) {
         // read directly
         SCOPED_RAW_TIMER(&stats.read_cache_file_directly_timer);
@@ -419,7 +419,6 @@ void CachedRemoteFileReader::_update_stats(const 
ReadStatistics& read_stats,
         statis->inverted_index_remote_io_timer += read_stats.remote_read_timer;
     }
 
-    g_skip_cache_num << read_stats.skip_cache;
     g_skip_cache_sum << read_stats.skip_cache;
 }
 
diff --git a/be/src/vec/exec/scan/new_olap_scanner.cpp 
b/be/src/vec/exec/scan/new_olap_scanner.cpp
index 7711fd5e3ed..33a7e54f8b7 100644
--- a/be/src/vec/exec/scan/new_olap_scanner.cpp
+++ b/be/src/vec/exec/scan/new_olap_scanner.cpp
@@ -580,6 +580,9 @@ void NewOlapScanner::update_realtime_counters() {
             _query_statistics->add_scan_bytes_from_remote_storage(
                     stats.file_cache_stats.bytes_read_from_remote);
         }
+
+        io::FileCacheProfileReporter 
cache_profile(local_state->_segment_profile.get());
+        cache_profile.update(&stats.file_cache_stats);
         DorisMetrics::instance()->query_scan_bytes_from_local->increment(
                 stats.file_cache_stats.bytes_read_from_local);
         DorisMetrics::instance()->query_scan_bytes_from_remote->increment(


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to