-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replication
-
None
-
Fully Compatible
-
Repl 2018-02-12, Repl 2018-02-26
-
0
Currently, replica_set_error_codes.js has asserts that a particular node must become secondary. But it is not guaranteed that this node will always win because the other secondary may also run for an election and win instead.
Just call .getPrimary() instead, which blocks until a new primary is elected.