github-actions[bot] commented on code in PR #44154:
URL: https://github.com/apache/doris/pull/44154#discussion_r1847555430
##########
cloud/test/recycler_test.cpp:
##########
@@ -2576,6 +2615,179 @@ TEST(CheckerTest, do_inspect) {
}
}
+TEST(CheckerTest, delete_bitmap_inverted_check_normal) {
+ // normal case, all delete bitmaps belong to a rowset
+ auto txn_kv = std::make_shared<MemTxnKv>();
+ ASSERT_EQ(txn_kv->init(), 0);
+
+ InstanceInfoPB instance;
+ instance.set_instance_id(instance_id);
+ auto obj_info = instance.add_obj_info();
+ obj_info->set_id("1");
+
+ InstanceChecker checker(txn_kv, instance_id);
+ ASSERT_EQ(checker.init(instance), 0);
+ auto accessor = checker.accessor_map_.begin()->second;
+
+ std::unique_ptr<Transaction> txn;
+ ASSERT_EQ(TxnErrorCode::TXN_OK, txn_kv->create_txn(&txn));
+
+ constexpr int table_id = 10000, index_id = 10001, partition_id = 10002;
+ // create some rowsets with delete bitmaps in merge-on-write tablet
+ for (int tablet_id = 600001; tablet_id <= 600010; ++tablet_id) {
+ ASSERT_EQ(0,
+ create_tablet(txn_kv.get(), table_id, index_id,
partition_id, tablet_id, true));
+ int64_t rowset_start_id = 400;
+ for (int ver = 2; ver <= 10; ++ver) {
+ std::string rowset_id = std::to_string(rowset_start_id++);
+ create_committed_rowset_with_rowset_id(txn_kv.get(),
accessor.get(), "1", tablet_id,
+ ver, rowset_id, 1);
+ if (ver >= 5) {
+ auto delete_bitmap_key =
+ meta_delete_bitmap_key({instance_id, tablet_id,
rowset_id, ver, 0});
+ std::string delete_bitmap_val {"test"};
+ txn->put(delete_bitmap_key, delete_bitmap_val);
+ } else {
+ // delete bitmaps may be spilitted into mulitiple KVs if too
large
+ auto delete_bitmap_key =
+ meta_delete_bitmap_key({instance_id, tablet_id,
rowset_id, ver, 0});
+ std::string delete_bitmap_val(1000, 'A');
+ cloud::put(txn.get(), delete_bitmap_key, delete_bitmap_val, 0,
300);
+ }
+ }
+ }
+
+ // also create some rowsets without delete bitmaps in non merge-on-write
tablet
+ for (int tablet_id = 700001; tablet_id <= 700010; ++tablet_id) {
+ ASSERT_EQ(0,
+ create_tablet(txn_kv.get(), table_id, index_id,
partition_id, tablet_id, false));
+ int64_t rowset_start_id = 500;
+ for (int ver = 2; ver < 10; ++ver) {
+ std::string rowset_id = std::to_string(rowset_start_id++);
+ create_committed_rowset_with_rowset_id(txn_kv.get(),
accessor.get(), "1", tablet_id,
+ ver, rowset_id, 1);
+ }
+ }
+
+ ASSERT_EQ(TxnErrorCode::TXN_OK, txn->commit());
+
+ ASSERT_EQ(checker.do_delete_bitmap_inverted_check(), 0);
+}
+
+TEST(CheckerTest, delete_bitmap_inverted_check_abnormal) {
Review Comment:
warning: function 'TEST' exceeds recommended size/complexity thresholds
[readability-function-size]
```cpp
TEST(CheckerTest, delete_bitmap_inverted_check_abnormal) {
^
```
<details>
<summary>Additional context</summary>
**cloud/test/recycler_test.cpp:2676:** 112 lines including whitespace and
comments (threshold 80)
```cpp
TEST(CheckerTest, delete_bitmap_inverted_check_abnormal) {
^
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]