Track commit costs while ReportCommitCostEstimationRequest is in-flight

This commit is contained in:
sfc-gh-tclinkenbeard 2022-11-15 13:47:29 -08:00 committed by Trevor Clinkenbeard
parent a21f657429
commit 9a258e087b
2 changed files with 5 additions and 4 deletions

View File

@ -2565,14 +2565,14 @@ ACTOR Future<Void> reportTxnTagCommitCost(UID myID,
nextRequestTimer = Never();
if (db->get().ratekeeper.present()) {
nextReply = brokenPromiseToNever(db->get().ratekeeper.get().reportCommitCostEstimation.getReply(
ReportCommitCostEstimationRequest(*ssTrTagCommitCost)));
ReportCommitCostEstimationRequest(std::move(*ssTrTagCommitCost))));
ssTrTagCommitCost->clear();
} else {
nextReply = Never();
}
}
when(wait(nextReply)) {
nextReply = Never();
ssTrTagCommitCost->clear();
nextRequestTimer = delay(SERVER_KNOBS->REPORT_TRANSACTION_COST_ESTIMATION_DELAY);
}
}

View File

@ -150,8 +150,9 @@ struct ReportCommitCostEstimationRequest {
ReplyPromise<Void> reply;
ReportCommitCostEstimationRequest() {}
ReportCommitCostEstimationRequest(UIDTransactionTagMap<TransactionCommitCostEstimation> ssTrTagCommitCost)
: ssTrTagCommitCost(ssTrTagCommitCost) {}
explicit ReportCommitCostEstimationRequest(
UIDTransactionTagMap<TransactionCommitCostEstimation>&& ssTrTagCommitCost)
: ssTrTagCommitCost(std::move(ssTrTagCommitCost)) {}
template <class Ar>
void serialize(Ar& ar) {