-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replication
-
None
-
Fully Compatible
-
ALL
-
Repl 2017-05-08
-
0
getPrimary() gets the primary, but does not wait for the primary to be "stable". If two nodes decide to run for primary around the same time, they could both win in quick succession, and the first getPrimary() could return the first winner and the second getPrimary() could return the second winner. awaitNodesAgreeOnPrimary() is designed for precisely this situation, waiting for the nodes to agree on a primary to avoid this race.
let oldPrimary = this.stepdown(primary); primary = this.getPrimary(); this.upgradeNode(oldPrimary, options, user, pwd); let newPrimary = this.getPrimary(); if (noDowntimePossible) assert.eq(newPrimary, primary);