gavinchou commented on code in PR #40204: URL: https://github.com/apache/doris/pull/40204#discussion_r1766324693
########## cloud/src/meta-service/meta_service.cpp: ########## @@ -2080,6 +2080,146 @@ void MetaServiceImpl::get_delete_bitmap_update_lock(google::protobuf::RpcControl } } +void MetaServiceImpl::update_delete_bitmap_without_lock(google::protobuf::RpcController* controller, + const UpdateDeleteBitmapRequest* request, + UpdateDeleteBitmapResponse* response, + ::google::protobuf::Closure* done) { + RPC_PREPROCESS(update_delete_bitmap_without_lock); + std::string cloud_unique_id = request->has_cloud_unique_id() ? request->cloud_unique_id() : ""; + if (cloud_unique_id.empty()) { + code = MetaServiceCode::INVALID_ARGUMENT; + msg = "cloud unique id not set"; + return; + } + + instance_id = get_instance_id(resource_mgr_, cloud_unique_id); + if (instance_id.empty()) { + code = MetaServiceCode::INVALID_ARGUMENT; + msg = "empty instance_id"; + LOG(WARNING) << msg << ", cloud_unique_id=" << request->cloud_unique_id(); + return; + } + RPC_RATE_LIMIT(update_delete_bitmap_without_lock) + + uint32_t fdb_txn_size = 0; + auto tablet_id = request->tablet_id(); + + std::unique_ptr<Transaction> txn; + TxnErrorCode err = txn_kv_->create_txn(&txn); + if (err != TxnErrorCode::TXN_OK) { + code = cast_as<ErrCategory::CREATE>(err); + msg = "failed to init txn"; + return; + } + + PendingDeleteBitmapPB delete_bitmap_keys; + for (size_t i = 0; i < request->rowset_ids_size(); ++i) { + MetaDeleteBitmapInfo key_info {instance_id, tablet_id, request->rowset_ids(i), + request->versions(i), request->segment_ids(i)}; + std::string key; + meta_delete_bitmap_key(key_info, &key); + delete_bitmap_keys.add_delete_bitmap_keys(key); + } + + // remove old delete bitmap + + // Update delete bitmap for curent txn + for (size_t i = 0; i < request->rowset_ids_size(); ++i) { Review Comment: the for loop may last more than 5 seconds which results in "txn too old" error -- 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