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 d43111a4d41 branch-3.1: [bugfix](metrics) the uncompressed_bytes_read 
is different meaning when in pagecache and read from disk #53933 (#53942)
d43111a4d41 is described below

commit d43111a4d410b249360fbdb0098026fc53e001d1
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Jul 28 10:36:27 2025 +0800

    branch-3.1: [bugfix](metrics) the uncompressed_bytes_read is different 
meaning when in pagecache and read from disk #53933 (#53942)
    
    Cherry-picked from #53933
    
    Co-authored-by: yiguolei <[email protected]>
---
 be/src/olap/rowset/segment_v2/page_io.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/be/src/olap/rowset/segment_v2/page_io.cpp 
b/be/src/olap/rowset/segment_v2/page_io.cpp
index 4e1069888dc..b5d70aed21b 100644
--- a/be/src/olap/rowset/segment_v2/page_io.cpp
+++ b/be/src/olap/rowset/segment_v2/page_io.cpp
@@ -223,9 +223,6 @@ Status PageIO::read_and_decompress_page_(const 
PageReadOptions& opts, PageHandle
         // free memory of compressed page
         page = std::move(decompressed_page);
         page_slice = Slice(page->data(), footer->uncompressed_size() + 
footer_size + 4);
-        opts.stats->uncompressed_bytes_read += page_slice.size;
-    } else {
-        opts.stats->uncompressed_bytes_read += body_size;
     }
 
     if (opts.pre_decode && opts.encoding_info) {
@@ -239,6 +236,10 @@ Status PageIO::read_and_decompress_page_(const 
PageReadOptions& opts, PageHandle
 
     *body = Slice(page_slice.data, page_slice.size - 4 - footer_size);
     page->reset_size(page_slice.size);
+    // Uncompressed has 2 meanings: uncompress and decode. The buffer in 
pagecache maybe
+    // uncompressed or decoded. So that should update the 
uncompressed_bytes_read counter
+    // just before add it to pagecache, it will be consistency with reading 
data from page cache.
+    opts.stats->uncompressed_bytes_read += body->size;
     if (opts.use_page_cache && cache) {
         // insert this page into cache and return the cache handle
         cache->insert(cache_key, page.get(), &cache_handle, opts.type, 
opts.kept_in_memory);


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

Reply via email to