-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Replication
-
None
-
ALL
-
Repl 2017-01-23, Repl 2017-02-13, Repl 2017-03-06, Repl 2017-03-27
-
0
Earlier in this code block _isWaitingForDrainToComplete is set to false, and at that point isMaster will begin to return true. This is because isMaster does not wait for _canAcceptNonLocalWrites to be true to return true (which it probably should). This, however, occurs before we write the "new primary" noop to the server and log that "transition to primary complete; database writes are now permitted", which should happen before drain mode is complete (especially the "new primary" noop).
This code block also unlocks and relocks its mutex without checking if the state has changed afterwards, which should be reconsidered.
Related, but tangential is that _isWaitingForDrainToComplete and _isCatchingUp and _canAcceptNonLocalWrites are all related but currently function as 3 separate booleans. We should investigate if they can be combined into an enum.
- duplicates
-
SERVER-27120 Increase synchronization between producer/applier threads and stepdown/stepup
- Closed
- related to
-
SERVER-28269 Set _canAcceptNonLocalWrites at the end of signalDrainComplete()
- Closed