From 98d555b5aa94f77a7a24db891f73742f598b3734 Mon Sep 17 00:00:00 2001 From: Luwei <814383175@qq.com> Date: Sun, 4 Aug 2024 10:41:50 +0800 Subject: [PATCH 1/7] [fix](compaction) fix the longest continuous rowsets cannot be selected when missing rowsets (#38728) When version is missing, the code for selecting the longest continuous version has a bug. Only the version before the missing version will be selected. For example: the current version is version [1-1], version [2-2], version [4-4], version [5-5], version [6-6], version [7-7], and version [3-3] is missing. The current result is to return version [1-1], version [2-2] instead of version [4-4], version [5-5], version [6-6], version [7-7] --- be/src/olap/cumulative_compaction.cpp | 43 +++- be/src/olap/cumulative_compaction.h | 3 + be/test/olap/cumulative_compaction_test.cpp | 266 ++++++++++++++++++++ 3 files changed, 309 insertions(+), 3 deletions(-) create mode 100644 be/test/olap/cumulative_compaction_test.cpp diff --git a/be/src/olap/cumulative_compaction.cpp b/be/src/olap/cumulative_compaction.cpp index 04504432f195fa..e9e84d6456e04a 100644 --- a/be/src/olap/cumulative_compaction.cpp +++ b/be/src/olap/cumulative_compaction.cpp @@ -42,6 +42,42 @@ CumulativeCompaction::CumulativeCompaction(const TabletSharedPtr& tablet) CumulativeCompaction::~CumulativeCompaction() = default; +void CumulativeCompaction::find_longest_consecutive_version(std::vector* rowsets, + std::vector* missing_version) { + if (rowsets->empty()) { + return; + } + + RowsetSharedPtr prev_rowset = rowsets->front(); + size_t i = 1; + int max_start = 0; + int max_length = 1; + + int start = 0; + int length = 1; + for (; i < rowsets->size(); ++i) { + RowsetSharedPtr rowset = (*rowsets)[i]; + if (rowset->start_version() != prev_rowset->end_version() + 1) { + if (missing_version != nullptr) { + missing_version->push_back(prev_rowset->version()); + missing_version->push_back(rowset->version()); + } + start = i; + length = 1; + } else { + length++; + } + + if (length > max_length) { + max_start = start; + max_length = length; + } + + prev_rowset = rowset; + } + *rowsets = {rowsets->begin() + max_start, rowsets->begin() + max_start + max_length}; +} + Status CumulativeCompaction::prepare_compact() { if (!_tablet->init_succeeded()) { return Status::Error("_tablet init failed"); @@ -111,10 +147,11 @@ Status CumulativeCompaction::pick_rowsets_to_compact() { std::vector missing_versions; RETURN_IF_ERROR(find_longest_consecutive_version(&candidate_rowsets, &missing_versions)); if (!missing_versions.empty()) { - DCHECK(missing_versions.size() == 2); + DCHECK(missing_versions.size() % 2 == 0); LOG(WARNING) << "There are missed versions among rowsets. " - << "prev rowset verison=" << missing_versions[0] - << ", next rowset version=" << missing_versions[1] + << "total missed version size: " << missing_versions.size() / 2 + << " first missed version prev rowset verison=" << missing_versions[0] + << ", first missed version next rowset version=" << missing_versions[1] << ", tablet=" << _tablet->tablet_id(); } diff --git a/be/src/olap/cumulative_compaction.h b/be/src/olap/cumulative_compaction.h index 7ea7fb383f1ebb..8a9e94cc374717 100644 --- a/be/src/olap/cumulative_compaction.h +++ b/be/src/olap/cumulative_compaction.h @@ -46,6 +46,9 @@ class CumulativeCompaction : public Compaction { ReaderType compaction_type() const override { return ReaderType::READER_CUMULATIVE_COMPACTION; } + void find_longest_consecutive_version(std::vector* rowsets, + std::vector* missing_version); + private: Version _last_delete_version {-1, -1}; diff --git a/be/test/olap/cumulative_compaction_test.cpp b/be/test/olap/cumulative_compaction_test.cpp new file mode 100644 index 00000000000000..11258d8567d99a --- /dev/null +++ b/be/test/olap/cumulative_compaction_test.cpp @@ -0,0 +1,266 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include "olap/cumulative_compaction.h" + +#include +#include +#include +#include +#include + +#include +#include + +#include "common/status.h" +#include "cpp/sync_point.h" +#include "gtest/gtest_pred_impl.h" +#include "io/fs/local_file_system.h" +#include "olap/cumulative_compaction_policy.h" +#include "olap/data_dir.h" +#include "olap/rowset/rowset_factory.h" +#include "olap/storage_engine.h" +#include "olap/tablet_manager.h" +#include "util/threadpool.h" + +namespace doris { +using namespace config; + +class CumulativeCompactionTest : public testing::Test { +public: + virtual void SetUp() {} + + virtual void TearDown() {} +}; + +static RowsetSharedPtr create_rowset(Version version, int num_segments, bool overlapping, + int data_size) { + auto rs_meta = std::make_shared(); + rs_meta->set_rowset_type(BETA_ROWSET); // important + rs_meta->_rowset_meta_pb.set_start_version(version.first); + rs_meta->_rowset_meta_pb.set_end_version(version.second); + rs_meta->set_num_segments(num_segments); + rs_meta->set_segments_overlap(overlapping ? OVERLAPPING : NONOVERLAPPING); + rs_meta->set_total_disk_size(data_size); + RowsetSharedPtr rowset; + Status st = RowsetFactory::create_rowset(nullptr, "", std::move(rs_meta), &rowset); + if (!st.ok()) { + return nullptr; + } + return rowset; +} + +TEST_F(CumulativeCompactionTest, TestConsecutiveVersion) { + EngineOptions options; + StorageEngine storage_engine(options); + //TabletSharedPtr tablet; + + TabletMetaSharedPtr tablet_meta; + tablet_meta.reset(new TabletMeta(1, 2, 15673, 15674, 4, 5, TTabletSchema(), 6, {{7, 8}}, + UniqueId(9, 10), TTabletType::TABLET_TYPE_DISK, + TCompressionType::LZ4F)); + TabletSharedPtr tablet( + new Tablet(storage_engine, tablet_meta, nullptr, CUMULATIVE_SIZE_BASED_POLICY)); + + CumulativeCompaction cumu_compaction(storage_engine, tablet); + + { + std::vector rowsets; + for (int i = 2; i < 10; ++i) { + RowsetSharedPtr rs = create_rowset({i, i}, 1, false, 1024); + rowsets.push_back(rs); + } + std::vector missing_version; + cumu_compaction.find_longest_consecutive_version(&rowsets, &missing_version); + EXPECT_EQ(rowsets.size(), 8); + EXPECT_EQ(rowsets.front()->start_version(), 2); + EXPECT_EQ(rowsets.front()->end_version(), 2); + + EXPECT_EQ(rowsets.back()->start_version(), 9); + EXPECT_EQ(rowsets.back()->end_version(), 9); + + EXPECT_EQ(missing_version.size(), 0); + } + + { + std::vector rowsets; + for (int i = 2; i <= 4; ++i) { + RowsetSharedPtr rs = create_rowset({i, i}, 1, false, 1024); + rowsets.push_back(rs); + } + + for (int i = 6; i <= 10; ++i) { + RowsetSharedPtr rs = create_rowset({i, i}, 1, false, 1024); + rowsets.push_back(rs); + } + + for (int i = 12; i <= 13; ++i) { + RowsetSharedPtr rs = create_rowset({i, i}, 1, false, 1024); + rowsets.push_back(rs); + } + + std::vector missing_version; + cumu_compaction.find_longest_consecutive_version(&rowsets, &missing_version); + + EXPECT_EQ(rowsets.size(), 5); + EXPECT_EQ(rowsets.front()->start_version(), 6); + EXPECT_EQ(rowsets.front()->end_version(), 6); + EXPECT_EQ(rowsets.back()->start_version(), 10); + EXPECT_EQ(rowsets.back()->end_version(), 10); + + EXPECT_EQ(missing_version.size(), 4); + EXPECT_EQ(missing_version[0].first, 4); + EXPECT_EQ(missing_version[0].second, 4); + EXPECT_EQ(missing_version[1].first, 6); + EXPECT_EQ(missing_version[1].second, 6); + EXPECT_EQ(missing_version[2].first, 10); + EXPECT_EQ(missing_version[2].second, 10); + EXPECT_EQ(missing_version[3].first, 12); + EXPECT_EQ(missing_version[3].second, 12); + } + + { + std::vector rowsets; + for (int i = 2; i <= 2; ++i) { + RowsetSharedPtr rs = create_rowset({i, i}, 1, false, 1024); + rowsets.push_back(rs); + } + + for (int i = 4; i <= 4; ++i) { + RowsetSharedPtr rs = create_rowset({i, i}, 1, false, 1024); + rowsets.push_back(rs); + } + + std::vector missing_version; + cumu_compaction.find_longest_consecutive_version(&rowsets, &missing_version); + + EXPECT_EQ(rowsets.size(), 1); + EXPECT_EQ(rowsets.front()->start_version(), 2); + EXPECT_EQ(rowsets.front()->end_version(), 2); + EXPECT_EQ(rowsets.back()->start_version(), 2); + EXPECT_EQ(rowsets.back()->end_version(), 2); + + EXPECT_EQ(missing_version.size(), 2); + EXPECT_EQ(missing_version[0].first, 2); + EXPECT_EQ(missing_version[0].second, 2); + EXPECT_EQ(missing_version[1].first, 4); + EXPECT_EQ(missing_version[1].second, 4); + } + + { + std::vector rowsets; + RowsetSharedPtr rs = create_rowset({2, 3}, 1, false, 1024); + rowsets.push_back(rs); + rs = create_rowset({4, 5}, 1, false, 1024); + rowsets.push_back(rs); + + rs = create_rowset({9, 11}, 1, false, 1024); + rowsets.push_back(rs); + rs = create_rowset({12, 13}, 1, false, 1024); + rowsets.push_back(rs); + + std::vector missing_version; + cumu_compaction.find_longest_consecutive_version(&rowsets, &missing_version); + + EXPECT_EQ(rowsets.size(), 2); + EXPECT_EQ(rowsets.front()->start_version(), 2); + EXPECT_EQ(rowsets.front()->end_version(), 3); + EXPECT_EQ(rowsets.back()->start_version(), 4); + EXPECT_EQ(rowsets.back()->end_version(), 5); + + EXPECT_EQ(missing_version.size(), 2); + EXPECT_EQ(missing_version[0].first, 4); + EXPECT_EQ(missing_version[0].second, 5); + EXPECT_EQ(missing_version[1].first, 9); + EXPECT_EQ(missing_version[1].second, 11); + } + + { + std::vector rowsets; + for (int i = 2; i <= 2; ++i) { + RowsetSharedPtr rs = create_rowset({i, i}, 1, false, 1024); + rowsets.push_back(rs); + } + + std::vector missing_version; + cumu_compaction.find_longest_consecutive_version(&rowsets, &missing_version); + EXPECT_EQ(rowsets.size(), 1); + EXPECT_EQ(rowsets.front()->start_version(), 2); + EXPECT_EQ(rowsets.front()->end_version(), 2); + + EXPECT_EQ(rowsets.back()->start_version(), 2); + EXPECT_EQ(rowsets.back()->end_version(), 2); + EXPECT_EQ(missing_version.size(), 0); + } + + { + std::vector rowsets; + for (int i = 2; i <= 2; ++i) { + RowsetSharedPtr rs = create_rowset({i, i}, 1, false, 1024); + rowsets.push_back(rs); + } + + std::vector missing_version; + cumu_compaction.find_longest_consecutive_version(&rowsets, &missing_version); + EXPECT_EQ(rowsets.size(), 1); + EXPECT_EQ(rowsets.front()->start_version(), 2); + EXPECT_EQ(rowsets.front()->end_version(), 2); + + EXPECT_EQ(rowsets.back()->start_version(), 2); + EXPECT_EQ(rowsets.back()->end_version(), 2); + EXPECT_EQ(missing_version.size(), 0); + } + + { + std::vector rowsets; + for (int i = 2; i <= 4; ++i) { + RowsetSharedPtr rs = create_rowset({i, i}, 1, false, 1024); + rowsets.push_back(rs); + } + + for (int i = 6; i <= 10; ++i) { + RowsetSharedPtr rs = create_rowset({i, i}, 1, false, 1024); + rowsets.push_back(rs); + } + + for (int i = 12; i <= 20; ++i) { + RowsetSharedPtr rs = create_rowset({i, i}, 1, false, 1024); + rowsets.push_back(rs); + } + + std::vector missing_version; + cumu_compaction.find_longest_consecutive_version(&rowsets, &missing_version); + + EXPECT_EQ(rowsets.size(), 9); + EXPECT_EQ(rowsets.front()->start_version(), 12); + EXPECT_EQ(rowsets.front()->end_version(), 12); + EXPECT_EQ(rowsets.back()->start_version(), 20); + EXPECT_EQ(rowsets.back()->end_version(), 20); + + EXPECT_EQ(missing_version.size(), 4); + EXPECT_EQ(missing_version[0].first, 4); + EXPECT_EQ(missing_version[0].second, 4); + EXPECT_EQ(missing_version[1].first, 6); + EXPECT_EQ(missing_version[1].second, 6); + EXPECT_EQ(missing_version[2].first, 10); + EXPECT_EQ(missing_version[2].second, 10); + EXPECT_EQ(missing_version[3].first, 12); + EXPECT_EQ(missing_version[3].second, 12); + } +} + +} // namespace doris From 6bb012f51962bc1dfc4414863fcde254b13a11c1 Mon Sep 17 00:00:00 2001 From: Luwei <814383175@qq.com> Date: Tue, 13 Aug 2024 08:42:10 +0800 Subject: [PATCH 2/7] fix --- be/src/olap/compaction.cpp | 27 ++++++++++++++------ be/src/olap/cumulative_compaction.cpp | 36 --------------------------- be/src/olap/cumulative_compaction.h | 3 --- 3 files changed, 20 insertions(+), 46 deletions(-) diff --git a/be/src/olap/compaction.cpp b/be/src/olap/compaction.cpp index fa2d89352be985..6488f574bc2e4a 100644 --- a/be/src/olap/compaction.cpp +++ b/be/src/olap/compaction.cpp @@ -1127,13 +1127,19 @@ void Compaction::gc_output_rowset() { // Find the longest consecutive version path in "rowset", from beginning. // Two versions before and after the missing version will be saved in missing_version, // if missing_version is not null. -Status Compaction::find_longest_consecutive_version(std::vector* rowsets, - std::vector* missing_version) { +void Compaction::find_longest_consecutive_version(std::vector* rowsets, + std::vector* missing_version) { if (rowsets->empty()) { - return Status::OK(); + return; } + RowsetSharedPtr prev_rowset = rowsets->front(); size_t i = 1; + int max_start = 0; + int max_length = 1; + + int start = 0; + int length = 1; for (; i < rowsets->size(); ++i) { RowsetSharedPtr rowset = (*rowsets)[i]; if (rowset->start_version() != prev_rowset->end_version() + 1) { @@ -1141,13 +1147,20 @@ Status Compaction::find_longest_consecutive_version(std::vector missing_version->push_back(prev_rowset->version()); missing_version->push_back(rowset->version()); } - break; + start = i; + length = 1; + } else { + length++; } + + if (length > max_length) { + max_start = start; + max_length = length; + } + prev_rowset = rowset; } - - rowsets->resize(i); - return Status::OK(); + *rowsets = {rowsets->begin() + max_start, rowsets->begin() + max_start + max_length}; } Status Compaction::check_version_continuity(const std::vector& rowsets) { diff --git a/be/src/olap/cumulative_compaction.cpp b/be/src/olap/cumulative_compaction.cpp index e9e84d6456e04a..d7fc4da44739e9 100644 --- a/be/src/olap/cumulative_compaction.cpp +++ b/be/src/olap/cumulative_compaction.cpp @@ -42,42 +42,6 @@ CumulativeCompaction::CumulativeCompaction(const TabletSharedPtr& tablet) CumulativeCompaction::~CumulativeCompaction() = default; -void CumulativeCompaction::find_longest_consecutive_version(std::vector* rowsets, - std::vector* missing_version) { - if (rowsets->empty()) { - return; - } - - RowsetSharedPtr prev_rowset = rowsets->front(); - size_t i = 1; - int max_start = 0; - int max_length = 1; - - int start = 0; - int length = 1; - for (; i < rowsets->size(); ++i) { - RowsetSharedPtr rowset = (*rowsets)[i]; - if (rowset->start_version() != prev_rowset->end_version() + 1) { - if (missing_version != nullptr) { - missing_version->push_back(prev_rowset->version()); - missing_version->push_back(rowset->version()); - } - start = i; - length = 1; - } else { - length++; - } - - if (length > max_length) { - max_start = start; - max_length = length; - } - - prev_rowset = rowset; - } - *rowsets = {rowsets->begin() + max_start, rowsets->begin() + max_start + max_length}; -} - Status CumulativeCompaction::prepare_compact() { if (!_tablet->init_succeeded()) { return Status::Error("_tablet init failed"); diff --git a/be/src/olap/cumulative_compaction.h b/be/src/olap/cumulative_compaction.h index 8a9e94cc374717..7ea7fb383f1ebb 100644 --- a/be/src/olap/cumulative_compaction.h +++ b/be/src/olap/cumulative_compaction.h @@ -46,9 +46,6 @@ class CumulativeCompaction : public Compaction { ReaderType compaction_type() const override { return ReaderType::READER_CUMULATIVE_COMPACTION; } - void find_longest_consecutive_version(std::vector* rowsets, - std::vector* missing_version); - private: Version _last_delete_version {-1, -1}; From a036e1c4eb8c2e798c819f106d8b1bbaeca3a490 Mon Sep 17 00:00:00 2001 From: Luwei <814383175@qq.com> Date: Tue, 13 Aug 2024 08:45:17 +0800 Subject: [PATCH 3/7] fix --- be/src/olap/compaction.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/be/src/olap/compaction.cpp b/be/src/olap/compaction.cpp index 6488f574bc2e4a..2d894aeaa3684d 100644 --- a/be/src/olap/compaction.cpp +++ b/be/src/olap/compaction.cpp @@ -1130,7 +1130,7 @@ void Compaction::gc_output_rowset() { void Compaction::find_longest_consecutive_version(std::vector* rowsets, std::vector* missing_version) { if (rowsets->empty()) { - return; + return Status::OK(); } RowsetSharedPtr prev_rowset = rowsets->front(); @@ -1161,6 +1161,7 @@ void Compaction::find_longest_consecutive_version(std::vector* prev_rowset = rowset; } *rowsets = {rowsets->begin() + max_start, rowsets->begin() + max_start + max_length}; + return Status::OK(); } Status Compaction::check_version_continuity(const std::vector& rowsets) { From 06cf718f3a07aaeb57c97ad623d5b63d878dd7a2 Mon Sep 17 00:00:00 2001 From: Luwei <814383175@qq.com> Date: Tue, 13 Aug 2024 08:47:00 +0800 Subject: [PATCH 4/7] fix --- be/src/olap/compaction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/be/src/olap/compaction.cpp b/be/src/olap/compaction.cpp index 2d894aeaa3684d..512e2d3cf780bf 100644 --- a/be/src/olap/compaction.cpp +++ b/be/src/olap/compaction.cpp @@ -1127,7 +1127,7 @@ void Compaction::gc_output_rowset() { // Find the longest consecutive version path in "rowset", from beginning. // Two versions before and after the missing version will be saved in missing_version, // if missing_version is not null. -void Compaction::find_longest_consecutive_version(std::vector* rowsets, +Status Compaction::find_longest_consecutive_version(std::vector* rowsets, std::vector* missing_version) { if (rowsets->empty()) { return Status::OK(); From faef5b71594d369da51248316dd701d63f36bf12 Mon Sep 17 00:00:00 2001 From: Luwei <814383175@qq.com> Date: Tue, 13 Aug 2024 08:47:45 +0800 Subject: [PATCH 5/7] fix --- be/src/olap/compaction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/be/src/olap/compaction.cpp b/be/src/olap/compaction.cpp index 512e2d3cf780bf..749f81893988bd 100644 --- a/be/src/olap/compaction.cpp +++ b/be/src/olap/compaction.cpp @@ -1128,7 +1128,7 @@ void Compaction::gc_output_rowset() { // Two versions before and after the missing version will be saved in missing_version, // if missing_version is not null. Status Compaction::find_longest_consecutive_version(std::vector* rowsets, - std::vector* missing_version) { + std::vector* missing_version) { if (rowsets->empty()) { return Status::OK(); } From ed8875044c1b0a9162dce2fddff3ca2cff4285b4 Mon Sep 17 00:00:00 2001 From: Luwei <814383175@qq.com> Date: Tue, 13 Aug 2024 10:20:09 +0800 Subject: [PATCH 6/7] fix --- be/test/olap/cumulative_compaction_test.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/be/test/olap/cumulative_compaction_test.cpp b/be/test/olap/cumulative_compaction_test.cpp index 11258d8567d99a..ee4401092cf740 100644 --- a/be/test/olap/cumulative_compaction_test.cpp +++ b/be/test/olap/cumulative_compaction_test.cpp @@ -27,7 +27,6 @@ #include #include "common/status.h" -#include "cpp/sync_point.h" #include "gtest/gtest_pred_impl.h" #include "io/fs/local_file_system.h" #include "olap/cumulative_compaction_policy.h" From 456d89e7dbbe69d0189e1abab636028232699194 Mon Sep 17 00:00:00 2001 From: Luwei <814383175@qq.com> Date: Tue, 13 Aug 2024 11:41:37 +0800 Subject: [PATCH 7/7] fix --- be/test/olap/cumulative_compaction_test.cpp | 25 ++++++++++++++------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/be/test/olap/cumulative_compaction_test.cpp b/be/test/olap/cumulative_compaction_test.cpp index ee4401092cf740..a0d3d99093d3c1 100644 --- a/be/test/olap/cumulative_compaction_test.cpp +++ b/be/test/olap/cumulative_compaction_test.cpp @@ -75,7 +75,7 @@ TEST_F(CumulativeCompactionTest, TestConsecutiveVersion) { TabletSharedPtr tablet( new Tablet(storage_engine, tablet_meta, nullptr, CUMULATIVE_SIZE_BASED_POLICY)); - CumulativeCompaction cumu_compaction(storage_engine, tablet); + CumulativeCompaction cumu_compaction(tablet); { std::vector rowsets; @@ -84,7 +84,8 @@ TEST_F(CumulativeCompactionTest, TestConsecutiveVersion) { rowsets.push_back(rs); } std::vector missing_version; - cumu_compaction.find_longest_consecutive_version(&rowsets, &missing_version); + Status st = cumu_compaction.find_longest_consecutive_version(&rowsets, &missing_version); + EXPECT_TRUE(st.OK()); EXPECT_EQ(rowsets.size(), 8); EXPECT_EQ(rowsets.front()->start_version(), 2); EXPECT_EQ(rowsets.front()->end_version(), 2); @@ -113,7 +114,8 @@ TEST_F(CumulativeCompactionTest, TestConsecutiveVersion) { } std::vector missing_version; - cumu_compaction.find_longest_consecutive_version(&rowsets, &missing_version); + Status st = cumu_compaction.find_longest_consecutive_version(&rowsets, &missing_version); + EXPECT_TRUE(st.OK()); EXPECT_EQ(rowsets.size(), 5); EXPECT_EQ(rowsets.front()->start_version(), 6); @@ -145,7 +147,8 @@ TEST_F(CumulativeCompactionTest, TestConsecutiveVersion) { } std::vector missing_version; - cumu_compaction.find_longest_consecutive_version(&rowsets, &missing_version); + Status st = cumu_compaction.find_longest_consecutive_version(&rowsets, &missing_version); + EXPECT_TRUE(st.OK()); EXPECT_EQ(rowsets.size(), 1); EXPECT_EQ(rowsets.front()->start_version(), 2); @@ -173,7 +176,8 @@ TEST_F(CumulativeCompactionTest, TestConsecutiveVersion) { rowsets.push_back(rs); std::vector missing_version; - cumu_compaction.find_longest_consecutive_version(&rowsets, &missing_version); + Status st = cumu_compaction.find_longest_consecutive_version(&rowsets, &missing_version); + EXPECT_TRUE(st.OK()); EXPECT_EQ(rowsets.size(), 2); EXPECT_EQ(rowsets.front()->start_version(), 2); @@ -196,7 +200,9 @@ TEST_F(CumulativeCompactionTest, TestConsecutiveVersion) { } std::vector missing_version; - cumu_compaction.find_longest_consecutive_version(&rowsets, &missing_version); + Status st = cumu_compaction.find_longest_consecutive_version(&rowsets, &missing_version); + EXPECT_TRUE(st.OK()); + EXPECT_EQ(rowsets.size(), 1); EXPECT_EQ(rowsets.front()->start_version(), 2); EXPECT_EQ(rowsets.front()->end_version(), 2); @@ -214,7 +220,9 @@ TEST_F(CumulativeCompactionTest, TestConsecutiveVersion) { } std::vector missing_version; - cumu_compaction.find_longest_consecutive_version(&rowsets, &missing_version); + Status st = cumu_compaction.find_longest_consecutive_version(&rowsets, &missing_version); + EXPECT_TRUE(st.OK()); + EXPECT_EQ(rowsets.size(), 1); EXPECT_EQ(rowsets.front()->start_version(), 2); EXPECT_EQ(rowsets.front()->end_version(), 2); @@ -242,7 +250,8 @@ TEST_F(CumulativeCompactionTest, TestConsecutiveVersion) { } std::vector missing_version; - cumu_compaction.find_longest_consecutive_version(&rowsets, &missing_version); + Status st = cumu_compaction.find_longest_consecutive_version(&rowsets, &missing_version); + EXPECT_TRUE(st.OK()); EXPECT_EQ(rowsets.size(), 9); EXPECT_EQ(rowsets.front()->start_version(), 12);