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

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


The following commit(s) were added to refs/heads/branch-4.1 by this push:
     new 45d62fcd0de [fix](file cache) Fix peer IO profile statistics diff 
(#68999)
45d62fcd0de is described below

commit 45d62fcd0deec743b2e40a93775d4ca5e950de50
Author: deardeng <[email protected]>
AuthorDate: Wed Oct 14 09:27:46 2026 +0800

    [fix](file cache) Fix peer IO profile statistics diff (#68999)
    
    The file cache profile delta omitted cross-CG, same-CG, race, and
    lazy-fetch counters, so incremental reports dropped these values.
    
    Include every peer IO field in the delta and cover the behavior with
    FileCacheProfileReporterTest.
    
    ### What problem does this PR solve?
    
    Issue Number: close #xxx
    
    Related PR: #xxx
    
    Problem Summary:
    
    ### Release note
    
    None
    
    ### Check List (For Author)
    
    - Test <!-- At least one of them must be included. -->
        - [ ] Regression test
        - [ ] Unit Test
        - [ ] Manual test (add detailed scripts or steps below)
        - [ ] No need to test or manual test. Explain why:
    - [ ] This is a refactor/code format and no logic has been changed.
            - [ ] Previous test can cover this change.
            - [ ] No code files have been changed.
            - [ ] Other reason <!-- Add your reason?  -->
    
    - Behavior changed:
        - [ ] No.
        - [ ] Yes. <!-- Explain the behavior change -->
    
    - Does this need documentation?
        - [ ] No.
    - [ ] Yes. <!-- Add document PR link here. eg:
    https://github.com/apache/doris-website/pull/1214 -->
    
    ### Check List (For Reviewer who merge this PR)
    
    - [ ] Confirm the release note
    - [ ] Confirm test cases
    - [ ] Confirm document
    - [ ] Add branch pick label <!-- Add branch pick label that this PR
    should merge into -->
---
 be/src/io/cache/block_file_cache_profile.cpp       | 11 ++++++++++
 .../block_file_cache_profile_reporter_test.cpp     | 24 ++++++++++++++++++++++
 2 files changed, 35 insertions(+)

diff --git a/be/src/io/cache/block_file_cache_profile.cpp 
b/be/src/io/cache/block_file_cache_profile.cpp
index 366cf6fd684..6572fee22d5 100644
--- a/be/src/io/cache/block_file_cache_profile.cpp
+++ b/be/src/io/cache/block_file_cache_profile.cpp
@@ -137,6 +137,17 @@ FileCacheStatistics diff_file_cache_statistics(const 
FileCacheStatistics& curren
     SUBTRACT_FIELD(segment_footer_index_bytes_write_into_cache);
     SUBTRACT_FIELD(remote_only_on_miss_triggered);
     SUBTRACT_FIELD(remote_only_on_miss_threshold_bytes);
+
+    SUBTRACT_FIELD(num_cross_cg_peer_io_total);
+    SUBTRACT_FIELD(bytes_read_from_cross_cg_peer);
+    SUBTRACT_FIELD(cross_cg_peer_io_timer);
+    SUBTRACT_FIELD(num_same_cg_peer_io_total);
+    SUBTRACT_FIELD(bytes_read_from_same_cg_peer);
+    SUBTRACT_FIELD(same_cg_peer_io_timer);
+    SUBTRACT_FIELD(num_peer_race_peer_win);
+    SUBTRACT_FIELD(num_peer_race_s3_win);
+    SUBTRACT_FIELD(num_peer_lazy_fetch);
+    SUBTRACT_FIELD(peer_lazy_fetch_timer);
 #undef SUBTRACT_FIELD
     return diff;
 }
diff --git a/be/test/io/cache/block_file_cache_profile_reporter_test.cpp 
b/be/test/io/cache/block_file_cache_profile_reporter_test.cpp
index 4836bcb2638..25585de6de5 100644
--- a/be/test/io/cache/block_file_cache_profile_reporter_test.cpp
+++ b/be/test/io/cache/block_file_cache_profile_reporter_test.cpp
@@ -65,6 +65,16 @@ io::FileCacheStatistics make_file_cache_stats(int64_t 
multiplier) {
     stats.probe_miss = multiplier * 53;
     stats.block_wait_success = multiplier * 54;
     stats.block_wait_timeout = multiplier * 55;
+    stats.num_cross_cg_peer_io_total = multiplier * 31;
+    stats.bytes_read_from_cross_cg_peer = multiplier * 32;
+    stats.cross_cg_peer_io_timer = multiplier * 33;
+    stats.num_same_cg_peer_io_total = multiplier * 34;
+    stats.bytes_read_from_same_cg_peer = multiplier * 35;
+    stats.same_cg_peer_io_timer = multiplier * 36;
+    stats.num_peer_race_peer_win = multiplier * 37;
+    stats.num_peer_race_s3_win = multiplier * 38;
+    stats.num_peer_lazy_fetch = multiplier * 39;
+    stats.peer_lazy_fetch_timer = multiplier * 40;
     return stats;
 }
 
@@ -118,6 +128,16 @@ void expect_file_cache_stats_eq(const 
io::FileCacheStatistics& actual,
     EXPECT_EQ(actual.probe_miss, expected.probe_miss);
     EXPECT_EQ(actual.block_wait_success, expected.block_wait_success);
     EXPECT_EQ(actual.block_wait_timeout, expected.block_wait_timeout);
+    EXPECT_EQ(actual.num_cross_cg_peer_io_total, 
expected.num_cross_cg_peer_io_total);
+    EXPECT_EQ(actual.bytes_read_from_cross_cg_peer, 
expected.bytes_read_from_cross_cg_peer);
+    EXPECT_EQ(actual.cross_cg_peer_io_timer, expected.cross_cg_peer_io_timer);
+    EXPECT_EQ(actual.num_same_cg_peer_io_total, 
expected.num_same_cg_peer_io_total);
+    EXPECT_EQ(actual.bytes_read_from_same_cg_peer, 
expected.bytes_read_from_same_cg_peer);
+    EXPECT_EQ(actual.same_cg_peer_io_timer, expected.same_cg_peer_io_timer);
+    EXPECT_EQ(actual.num_peer_race_peer_win, expected.num_peer_race_peer_win);
+    EXPECT_EQ(actual.num_peer_race_s3_win, expected.num_peer_race_s3_win);
+    EXPECT_EQ(actual.num_peer_lazy_fetch, expected.num_peer_lazy_fetch);
+    EXPECT_EQ(actual.peer_lazy_fetch_timer, expected.peer_lazy_fetch_timer);
 }
 
 } // namespace
@@ -195,6 +215,10 @@ TEST(FileCacheProfileReporterTest, 
ReporterAggregatesDeltaReportsToExactFinalTot
               after_second_report.block_wait_success);
     EXPECT_EQ(profile->get_counter("BlockWaitTimeoutCount")->value(),
               after_second_report.block_wait_timeout);
+    EXPECT_EQ(profile->get_counter("CrossCGPeerIOTime")->value(),
+              after_second_report.cross_cg_peer_io_timer);
+    EXPECT_EQ(profile->get_counter("PeerLazyFetchTime")->value(),
+              after_second_report.peer_lazy_fetch_timer);
 }
 
 } // namespace doris


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

Reply via email to