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

dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 66577bb9cfb [fix](filecache) fix BytesScannedFromCache/Local always 
zero (#55929)
66577bb9cfb is described below

commit 66577bb9cfb0af0ec8db2974fa6edbd9f658fa75
Author: zhengyu <[email protected]>
AuthorDate: Sun Sep 14 11:05:21 2025 +0800

    [fix](filecache) fix BytesScannedFromCache/Local always zero (#55929)
    
    forget update profile counters in update_realtime_counters. bug
    introduced in #52232
---
 be/src/io/cache/cached_remote_file_reader.cpp | 3 +--
 be/src/vec/exec/scan/olap_scanner.cpp         | 2 ++
 2 files changed, 3 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 839d798a7c5..665dd099254 100644
--- a/be/src/io/cache/cached_remote_file_reader.cpp
+++ b/be/src/io/cache/cached_remote_file_reader.cpp
@@ -149,6 +149,7 @@ Status CachedRemoteFileReader::read_at_impl(size_t offset, 
Slice result, size_t*
         return Status::OK();
     }
     ReadStatistics stats;
+    stats.bytes_read += bytes_req;
     auto defer_func = [&](int*) {
         if (io_ctx->file_cache_stats && !is_dryrun) {
             // update stats in io_ctx, for query profile
@@ -160,7 +161,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);
@@ -405,7 +405,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/olap_scanner.cpp 
b/be/src/vec/exec/scan/olap_scanner.cpp
index 9e65c55a890..606d1757b1b 100644
--- a/be/src/vec/exec/scan/olap_scanner.cpp
+++ b/be/src/vec/exec/scan/olap_scanner.cpp
@@ -624,6 +624,8 @@ void OlapScanner::update_realtime_counters() {
                 ->io_context()
                 ->update_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