forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
storage: evaluate proposals without lock
The main objective of this change is to (later) enable proposer-evaluated KV to compute the `WriteBatch` when evaluating a proposal (i.e. when turning a `BatchRequest` into a `*ProposalData`). The previous code assumes making a proposal is cheap, and thus it is done under a large critical sections. MaxLeaseIndex is assigned at the latest possible moment before submitting to Raft. Multiple inbound requests can pass the command queue without interacting, and it's important to assign the Lease index only right before when the proposal is submitted to Raft. Note that the command queue currently doesn't cover all the data accessed by Raft commands (cockroachdb#10084) and that a discussion of how precisely command evaluation will work is still being discussed (cockroachdb#6290). Nevertheless, this change should be safe and a step in the right direction.
- Loading branch information
Showing
2 changed files
with
173 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.