Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-28487

upgradePrimary should call awaitNodesAgreeOnPrimary() before it gets the primary

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.5.7
    • None
    • Replication
    • None
    • Fully Compatible
    • ALL
    • Repl 2017-05-08
    • 0

    Description

      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);
      

      Attachments

        Activity

          People

            spencer@mongodb.com Spencer Brody (Inactive)
            judah.schvimer@mongodb.com Judah Schvimer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: