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

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


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 6ecd55fa9e0 [cherry-pick](branch-2.1) Pick "[Fix](table size) Fix MoW 
table merge data fault (#40880)" (#43610)
6ecd55fa9e0 is described below

commit 6ecd55fa9e082dad754065f300da5d49c923dc3c
Author: abmdocrt <[email protected]>
AuthorDate: Wed Nov 13 14:43:18 2024 +0800

    [cherry-pick](branch-2.1) Pick "[Fix](table size) Fix MoW table merge data 
fault (#40880)" (#43610)
---
 be/src/olap/rowset/rowset.cpp | 1 +
 be/src/olap/rowset/rowset.h   | 3 ++-
 be/test/olap/tablet_test.cpp  | 6 +++---
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/be/src/olap/rowset/rowset.cpp b/be/src/olap/rowset/rowset.cpp
index 208d05f456c..eaaf881f8d9 100644
--- a/be/src/olap/rowset/rowset.cpp
+++ b/be/src/olap/rowset/rowset.cpp
@@ -102,6 +102,7 @@ void Rowset::merge_rowset_meta(const RowsetMetaSharedPtr& 
other) {
     _rowset_meta->set_num_segments(num_segments() + other->num_segments());
     _rowset_meta->set_num_rows(num_rows() + other->num_rows());
     _rowset_meta->set_data_disk_size(data_disk_size() + 
other->data_disk_size());
+    _rowset_meta->set_total_disk_size(total_disk_size() + 
other->total_disk_size());
     _rowset_meta->set_index_disk_size(index_disk_size() + 
other->index_disk_size());
     std::vector<KeyBoundsPB> key_bounds;
     other->get_segments_key_bounds(&key_bounds);
diff --git a/be/src/olap/rowset/rowset.h b/be/src/olap/rowset/rowset.h
index fca55a4ce22..764570748a9 100644
--- a/be/src/olap/rowset/rowset.h
+++ b/be/src/olap/rowset/rowset.h
@@ -146,7 +146,8 @@ public:
     int64_t start_version() const { return rowset_meta()->version().first; }
     int64_t end_version() const { return rowset_meta()->version().second; }
     size_t index_disk_size() const { return rowset_meta()->index_disk_size(); }
-    size_t data_disk_size() const { return rowset_meta()->total_disk_size(); }
+    size_t data_disk_size() const { return rowset_meta()->data_disk_size(); }
+    size_t total_disk_size() const { return rowset_meta()->total_disk_size(); }
     bool empty() const { return rowset_meta()->empty(); }
     bool zero_num_rows() const { return rowset_meta()->num_rows() == 0; }
     size_t num_rows() const { return rowset_meta()->num_rows(); }
diff --git a/be/test/olap/tablet_test.cpp b/be/test/olap/tablet_test.cpp
index 8d84b5141c3..d18ddb27dbb 100644
--- a/be/test/olap/tablet_test.cpp
+++ b/be/test/olap/tablet_test.cpp
@@ -363,7 +363,7 @@ TEST_F(TestTablet, cooldown_policy) {
         auto ret = _tablet->need_cooldown(&cooldown_timestamp, &file_size);
         ASSERT_TRUE(ret != nullptr);
         ASSERT_EQ(cooldown_timestamp, 250);
-        ASSERT_EQ(file_size, 84699);
+        ASSERT_EQ(file_size, 84464);
     }
 
     {
@@ -377,7 +377,7 @@ TEST_F(TestTablet, cooldown_policy) {
         auto ret = _tablet->need_cooldown(&cooldown_timestamp, &file_size);
         ASSERT_TRUE(ret != nullptr);
         ASSERT_EQ(cooldown_timestamp, 3800);
-        ASSERT_EQ(file_size, 84699);
+        ASSERT_EQ(file_size, 84464);
     }
 
     {
@@ -408,7 +408,7 @@ TEST_F(TestTablet, cooldown_policy) {
         int64_t expect_cooldown_timestamp = UnixSeconds() - 50;
         ASSERT_TRUE(ret != nullptr);
         ASSERT_EQ(cooldown_timestamp, expect_cooldown_timestamp);
-        ASSERT_EQ(file_size, 84699);
+        ASSERT_EQ(file_size, 84464);
     }
 }
 


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

Reply via email to