-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replication
-
None
-
Fully Compatible
-
ALL
-
Repl 2017-10-23, Repl 2017-11-13
-
0
When exiting drain mode, we check that we are in the proper state to complete our transition to primary after taking the global X lock. After that check, we release the repl coord mutex, write our on election oplog entry, reacquire the repl coord mutex, then complete our transition to primary.
In TopologyCoordinatorImpl::completeTransitionToPrimary, we invariant that we still are in in leaderElect mode or in a stepdown attempt. We can also, however, be the leader mode for an unconditional stepdown, as we might have heard of a higher term while we had the repl coord mutex unlocked. In this case the proper thing to do is complete our transition to primary (since we've already logged the transition to primary oplog entry), then immediately step down.
- related to
-
SERVER-48928 Allow primary-elect to complete drain mode even if it is stepping down unconditionally
- Closed