In try commit, wait for the read version future before waiting for the commit cost estimate. This allows us to give precedence to the database_locked error over errors thrown by the commit cost estimation.
This commit is contained in:
parent
ccfef328af
commit
93142e2c29
|
@ -6384,8 +6384,11 @@ ACTOR static Future<Void> tryCommit(Reference<TransactionState> trState,
|
|||
}
|
||||
|
||||
if (req.tagSet.present() && trState->options.priority < TransactionPriority::IMMEDIATE) {
|
||||
wait(store(req.transaction.read_snapshot, readVersion) &&
|
||||
store(req.commitCostEstimation, estimateCommitCosts(trState, &req.transaction)));
|
||||
state Future<Optional<ClientTrCommitCostEstimation>> commitCostFuture =
|
||||
estimateCommitCosts(trState, &req.transaction);
|
||||
// We need to wait for the read version first so that we can be notified if the database is locked
|
||||
wait(store(req.transaction.read_snapshot, readVersion));
|
||||
wait(store(req.commitCostEstimation, commitCostFuture));
|
||||
} else {
|
||||
wait(store(req.transaction.read_snapshot, readVersion));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue