-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replication
-
None
-
Fully Compatible
-
v4.0, v3.6
-
Repl 2018-08-27, Repl 2018-09-10, Repl 2018-09-24
With the new election handoff machinery, when a primary is sent replSetStepDown, the last thing it does as part of stepDown is send a replSetStepUp command to a node it believes to be best equipped to take over as the new primary. The stepUp command makes the new node call for an election, going through the normal election path which includes a dry-run election. Dry run elections aren't required for correctness, they are an optimization to limit unnecessary term changes due to failed elections. But since we already believe this node has a pretty good chance to win, and because the primary is stepping down so there's going to be a term change anyway, we could skip the dry run on the new primary candidate node and still have a good chance to win. This would reduce failover time in the common case for planned failover, at the risk of inducing extra unnecessary elections in the degenerate case.