gavinchou commented on code in PR #50314: URL: https://github.com/apache/doris/pull/50314#discussion_r2059660624
########## cloud/src/meta-service/meta_service_txn.cpp: ########## @@ -2514,6 +2514,20 @@ void commit_txn_with_sub_txn(const CommitTxnRequest* request, CommitTxnResponse* response->mutable_txn_info()->CopyFrom(txn_info); } // end commit_txn_with_sub_txn +static bool fuzzy_random() { + std::mt19937 gen {std::random_device {}()}; Review Comment: return (steady_clock():now().count() & 0x01) ########## cloud/src/meta-service/meta_service_txn.cpp: ########## @@ -2549,24 +2563,26 @@ void MetaServiceImpl::commit_txn(::google::protobuf::RpcController* controller, } TxnErrorCode err = TxnErrorCode::TXN_OK; - bool allow_txn_lazy_commit = + bool enable_txn_lazy_commit_feature = (request->has_is_2pc() && !request->is_2pc() && request->has_enable_txn_lazy_commit() && request->enable_txn_lazy_commit() && config::enable_cloud_txn_lazy_commit); - if (!allow_txn_lazy_commit || - (tmp_rowsets_meta.size() <= config::txn_lazy_commit_rowsets_thresold)) { + if (force_txn_lazy_commit() && Review Comment: while (!allow_txn_lazy_commit && (!enable_txn_lazy_commit_feature || (tmp_rowsets_meta.size() <= config::txn_lazy_commit_rowsets_thresold))) { if (force_lazy_commit()) { LOG(); break; } commit_txn_immediately(request, response, txn_kv_, txn_lazy_committer_, code, msg, instance_id, db_id, tmp_rowsets_meta, err); if ((MetaServiceCode::OK == code) || (TxnErrorCode::TXN_BYTES_TOO_LARGE != err) || !enable_txn_lazy_commit_feature) { if (err == TxnErrorCode::TXN_BYTES_TOO_LARGE) { msg += ", likely due to committing too many tablets. " "Please reduce the number of partitions involved in the load."; } return; } DCHECK(code != MetaServiceCode::OK); DCHECK(enable_txn_lazy_commit_feature); DCHECK(err == TxnErrorCode::TXN_BYTES_TOO_LARGE); LOG(INFO) << "txn_id=" << txn_id << " fallthrough commit_txn_eventually"; break; } -- 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