-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rac2,replica_rac2: fix deadlock due to HoldsSendTokensRaftMuLocked be…
…ing called with Replica.mu held It isn't convenient to not hold Replica.mu in the caller so instead we avoid needing replicaSendStream.mu (which is and must be ordered before Replica.mu). This is done by lifting replicaSendStream.mu.Tracker out of the mu struct. Additional changes: - All methods in replicaState and replicaSendStream are named to include what locks are held. This makes them verbose, but it is important for correctness. - Assertions are added for replicaSendStream.mu being held. - Todos are added to make Replica.raftMu and Replica.mu assertions free in replica_rac2 and rac2 code, and once that is done to add more assertions in rac2. - Todo is added to lift some more fields in replicaSendStream from inside mu (the main reason we need mu is for replicaSendStream.Notify). This todo is ordered after the previous one (more assertions). Fixes #132646, #132642 Epic: CRDB-37515 Release note: None
- Loading branch information
1 parent
35db162
commit 7c131f1
Showing
8 changed files
with
208 additions
and
150 deletions.
There are no files selected for viewing
310 changes: 183 additions & 127 deletions
310
pkg/kv/kvserver/kvflowcontrol/rac2/range_controller.go
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
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