zhannngchen commented on code in PR #49223:
URL: https://github.com/apache/doris/pull/49223#discussion_r2035433695


##########
cloud/test/meta_service_test.cpp:
##########
@@ -4830,6 +4830,1873 @@ TEST(MetaServiceTest, GetDeleteBitmapUpdateLock) {
     remove_delete_bitmap_lock(meta_service.get(), 2);
 }
 
+TEST(MetaServiceTest, DeleteBitmapUpdateLockCompatibilityTest) {
+    config::use_delete_bitmap_lock_random_version = false;
+    auto meta_service = get_meta_service();
+    [[maybe_unused]] auto sp = SyncPoint::get_instance();
+    std::unique_ptr<int, std::function<void(int*)>> defer(
+            (int*)0x01, [](int*) { 
SyncPoint::get_instance()->clear_all_call_backs(); });
+    sp->set_call_back("get_delete_bitmap_update_lock:commit:conflict", 
[&](auto&& args) {
+        auto* first_retry = try_any_cast<bool*>(args[0]);
+        if (*first_retry) {
+            *try_any_cast<TxnErrorCode*>(args[1]) = TxnErrorCode::TXN_CONFLICT;
+        } else {
+            *try_any_cast<TxnErrorCode*>(args[1]) = TxnErrorCode::TXN_OK;
+        }
+    });
+
+    int64_t table_id = 555;
+    // case 1: lock key does not exist, get and remove load lock in new way, 
success
+    config::use_delete_bitmap_lock_version = "v2";
+    brpc::Controller cntl;
+    GetDeleteBitmapUpdateLockRequest load_req;
+    GetDeleteBitmapUpdateLockResponse load_res;
+    load_req.set_cloud_unique_id("test_cloud_unique_id");

Review Comment:
   most of the request is duplicate code, why don't you abstract some methods? 
like `get_delete_bitmap_lock(int lock_id);`



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to