-
Notifications
You must be signed in to change notification settings - Fork 478
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wal: work around false data race in failoverWriter
failoverWriter has competing consumers who do compare-and-swap (CAS) to pop from recordQueue. Since the CAS releases the popped slots in buffer to the producer, the consumers need to read the contents of these slots before doing the CAS. After the CAS, they only use the read entries that they actually popped. But the fact that they read some entries, even though they are not going to use them, trips up the data race detector (since the read can be happening while the producer is writing). We work around this by introducing a consumer mutex to make consumption single threaded. This is acceptable since what we really care about is many concurrent producers, and consumers not interfering with producers. Informs #3230 Informs CRDB-35401
- Loading branch information
1 parent
08e0a86
commit ce293cc
Showing
1 changed file
with
74 additions
and
41 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