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


##########
cloud/src/meta-service/meta_service.cpp:
##########
@@ -1794,6 +1795,29 @@ void 
MetaServiceImpl::update_delete_bitmap(google::protobuf::RpcController* cont
         fdb_txn_size = fdb_txn_size + pending_key.size() + pending_val.size();
         LOG(INFO) << "xxx update delete bitmap put pending_key=" << 
hex(pending_key)
                   << " lock_id=" << request->lock_id() << " value_size: " << 
pending_val.size();
+    } else if (request->lock_id() == -3) {
+        std::unique_ptr<Transaction> txn_delete;
+        err = txn_kv_->create_txn(&txn_delete);
+        if (err != TxnErrorCode::TXN_OK) {
+            code = cast_as<ErrCategory::CREATE>(err);
+            msg = "failed to init txn";
+            return;
+        }
+        // delete existing key
+        for (size_t i = 0; i < request->rowset_ids_size(); ++i) {
+            auto& start_key = delete_bitmap_keys.delete_bitmap_keys(i);
+            std::string end_key {start_key};
+            encode_int64(INT64_MAX, &end_key);
+            txn_delete->remove(start_key, end_key);

Review Comment:
   should call `remove` in txn, rather than another independent transaction? if 
the `txn_delete` succeed but `txn` commit fail, the delete bitmap will be lost.



-- 
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]

Reply via email to