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

replSetRequestVotes doesn't synchronize between processing and recording request

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • 3.2.12, 3.4.2, 3.5.2
    • Affects Version/s: None
    • Component/s: Replication
    • Labels:
      None
    • Fully Compatible
    • ALL
    • v3.4, v3.2
    • Repl 2017-01-23

      The command processes the vote request then stores it without any synchronization. This can lead to the following sequence:

      1. Host A requests a vote for term 5 which we grant
      2. Host B requests a vote for term 6 which we grant
      3. Record that we voted for host B in term 6
      4. Record that we voted for host A in term 5

      Since we record votes using overwrite updates, the term 5 vote replaces the term 6 vote so we lose the fact that we already voted in term 6. Since we only read that document at startup, this can only result in conflicting votes if a shutdown occurs before we vote again. Unlike SERVER-27154 this can still happen with a clean shutdown.

            Assignee:
            judah.schvimer@mongodb.com Judah Schvimer
            Reporter:
            mathias@mongodb.com Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: