Skip to content

Commit

Permalink
[cherry-pick](branch-2.1) Pick "[Fix](table size) Fix MoW table merge…
Browse files Browse the repository at this point in the history
… data fault (#40880)" (#43610)
  • Loading branch information
Yukang-Lian authored Nov 13, 2024
1 parent 40d755a commit 6ecd55f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions be/src/olap/rowset/rowset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion be/src/olap/rowset/rowset.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ class Rowset : public std::enable_shared_from_this<Rowset> {
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(); }
Expand Down
6 changes: 3 additions & 3 deletions be/test/olap/tablet_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

{
Expand All @@ -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);
}

{
Expand Down Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 6ecd55f

Please sign in to comment.