You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2026/01/24 04:20:46 UTC

(doris) branch branch-4.0 updated: branch-4.0: [fix](filecache) fix global metrics leakage when stat is nullptr #59925 (#60204)

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

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


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new 21a50003063 branch-4.0: [fix](filecache) fix global metrics leakage when stat is nullptr #59925 (#60204)
21a50003063 is described below

commit 21a50003063a8d49e023873756039735893988b1
Author: github-actions[bot] <41...@users.noreply.github.com>
AuthorDate: Sat Jan 24 12:20:38 2026 +0800

    branch-4.0: [fix](filecache) fix global metrics leakage when stat is nullptr #59925 (#60204)
    
    Cherry-picked from #59925
    
    Signed-off-by: zhengyu <zh...@selectdb.com>
    Co-authored-by: zhengyu <zh...@selectdb.com>
---
 be/src/io/cache/cached_remote_file_reader.cpp | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/be/src/io/cache/cached_remote_file_reader.cpp b/be/src/io/cache/cached_remote_file_reader.cpp
index 972ee3c3592..6f4a48d23e4 100644
--- a/be/src/io/cache/cached_remote_file_reader.cpp
+++ b/be/src/io/cache/cached_remote_file_reader.cpp
@@ -314,13 +314,16 @@ Status CachedRemoteFileReader::read_at_impl(size_t offset, Slice result, size_t*
                     path().native(), offset, bytes_req, read_at_sw.elapsed_time_milliseconds(),
                     io_ctx->is_warmup);
         }
-        if (io_ctx->file_cache_stats && !is_dryrun) {
+        if (is_dryrun) {
+            return;
+        }
+        // update stats increment in this reading procedure for file cache metrics
+        FileCacheStatistics fcache_stats_increment;
+        _update_stats(stats, &fcache_stats_increment, io_ctx->is_inverted_index);
+        io::FileCacheMetrics::instance().update(&fcache_stats_increment);
+        if (io_ctx->file_cache_stats) {
             // update stats in io_ctx, for query profile
             _update_stats(stats, io_ctx->file_cache_stats, io_ctx->is_inverted_index);
-            // update stats increment in this reading procedure for file cache metrics
-            FileCacheStatistics fcache_stats_increment;
-            _update_stats(stats, &fcache_stats_increment, io_ctx->is_inverted_index);
-            io::FileCacheMetrics::instance().update(&fcache_stats_increment);
         }
     };
     std::unique_ptr<int, decltype(defer_func)> defer((int*)0x01, std::move(defer_func));


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org