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

replSetRequestVotes doesn't synchronize between processing and recording request

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2.12, 3.4.2, 3.5.2
    • Component/s: Replication
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.4, v3.2
    • Sprint:
      Repl 2017-01-23

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: