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 899ecd5c836 branch-4.1: [fix](auto partition) keep load row metrics 
monotonic for auto partition #64109 (#64136)
899ecd5c836 is described below

commit 899ecd5c836412dd38dcb1908a4ca8f3864801bc
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Jun 8 10:47:53 2026 +0800

    branch-4.1: [fix](auto partition) keep load row metrics monotonic for auto 
partition #64109 (#64136)
    
    Cherry-picked from #64109
    
    Co-authored-by: hui lai <[email protected]>
---
 be/src/exec/sink/vrow_distribution.cpp        | 3 ---
 be/src/exec/sink/writer/vtablet_writer.cpp    | 7 +++++--
 be/src/exec/sink/writer/vtablet_writer_v2.cpp | 7 +++++--
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/be/src/exec/sink/vrow_distribution.cpp 
b/be/src/exec/sink/vrow_distribution.cpp
index 130f21ad364..ff866e8c0be 100644
--- a/be/src/exec/sink/vrow_distribution.cpp
+++ b/be/src/exec/sink/vrow_distribution.cpp
@@ -27,7 +27,6 @@
 
 #include "common/cast_set.h"
 #include "common/logging.h"
-#include "common/metrics/doris_metrics.h"
 #include "common/status.h"
 #include "core/assert_cast.h"
 #include "core/column/column.h"
@@ -407,8 +406,6 @@ Status VRowDistribution::_deal_missing_map(const Block& 
input_block, Block* bloc
     rows_stat_val -= new_bt_rows - old_bt_rows;
     _state->update_num_rows_load_total(old_bt_rows - new_bt_rows);
     _state->update_num_bytes_load_total(old_bt_bytes - new_bt_bytes);
-    DorisMetrics::instance()->load_rows->increment(old_bt_rows - new_bt_rows);
-    DorisMetrics::instance()->load_bytes->increment(old_bt_bytes - 
new_bt_bytes);
 
     return Status::OK();
 }
diff --git a/be/src/exec/sink/writer/vtablet_writer.cpp 
b/be/src/exec/sink/writer/vtablet_writer.cpp
index 013da8e58c3..8e674bc88d6 100644
--- a/be/src/exec/sink/writer/vtablet_writer.cpp
+++ b/be/src/exec/sink/writer/vtablet_writer.cpp
@@ -2057,6 +2057,7 @@ Status VTabletWriter::write(RuntimeState* state, 
doris::Block& input_block) {
     // check out of limit
     RETURN_IF_ERROR(_send_new_partition_batch());
 
+    const bool is_replaying_batched_block = _row_distribution._deal_batched;
     auto rows = input_block.rows();
     auto bytes = input_block.bytes();
     if (UNLIKELY(rows == 0)) {
@@ -2071,8 +2072,10 @@ Status VTabletWriter::write(RuntimeState* state, 
doris::Block& input_block) {
     // the real 'num_rows_load_total' will be set when sink being closed.
     _state->update_num_rows_load_total(rows);
     _state->update_num_bytes_load_total(bytes);
-    DorisMetrics::instance()->load_rows->increment(rows);
-    DorisMetrics::instance()->load_bytes->increment(bytes);
+    if (!is_replaying_batched_block) {
+        DorisMetrics::instance()->load_rows->increment(rows);
+        DorisMetrics::instance()->load_bytes->increment(bytes);
+    }
 
     _row_distribution_watch.start();
     RETURN_IF_ERROR(_row_distribution.generate_rows_distribution(
diff --git a/be/src/exec/sink/writer/vtablet_writer_v2.cpp 
b/be/src/exec/sink/writer/vtablet_writer_v2.cpp
index ceb9adf859a..2494f238a4f 100644
--- a/be/src/exec/sink/writer/vtablet_writer_v2.cpp
+++ b/be/src/exec/sink/writer/vtablet_writer_v2.cpp
@@ -494,6 +494,7 @@ Status VTabletWriterV2::write(RuntimeState* state, Block& 
input_block) {
     // check out of limit
     RETURN_IF_ERROR(_send_new_partition_batch());
 
+    const bool is_replaying_batched_block = _row_distribution._deal_batched;
     auto input_rows = input_block.rows();
     auto input_bytes = input_block.bytes();
     if (UNLIKELY(input_rows == 0)) {
@@ -505,8 +506,10 @@ Status VTabletWriterV2::write(RuntimeState* state, Block& 
input_block) {
     // the real 'num_rows_load_total' will be set when sink being closed.
     _state->update_num_rows_load_total(input_rows);
     _state->update_num_bytes_load_total(input_bytes);
-    DorisMetrics::instance()->load_rows->increment(input_rows);
-    DorisMetrics::instance()->load_bytes->increment(input_bytes);
+    if (!is_replaying_batched_block) {
+        DorisMetrics::instance()->load_rows->increment(input_rows);
+        DorisMetrics::instance()->load_bytes->increment(input_bytes);
+    }
 
     SCOPED_RAW_TIMER(&_send_data_ns);
     // This is just for passing compilation.


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

Reply via email to