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

CmdReplSetFresh should take last election time and the 30 second lease time into account

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.6.1
    • Component/s: Replication
    • Labels:
      None

      Currently, as far as this issue is concerned, elections work as follows. Disregard all normal checks like priority, config, and OpTime.

      • in the first round CmdReplSetFresh is sent to all servers, and each respond with something that loosely says "I'll probably vote yes" or "I'll probably vote no".
      • in the second round, CmdReplSetElect is run, and each responds with "yes, if I have not voted for anyone else in the last 30 seconds, no otherwise".

      After this second round, anyone that voted yes will not vote for anyone else for thirty seconds.

      The issue here is that the first round gave false hope. Several machines said "I will likely vote for you", when in reality, the 30 second lease made a yea vote nearly impossible. This results in a failed election attempt, where other nodes that actually voted yea in the failed election are now barred from voting for 30 seconds.

      If the first phase takes the last election time into account, then the candidate does not bother with the second phase, and will not inadvertently bar other machines from voting for 30 seconds.

            Assignee:
            Unassigned Unassigned
            Reporter:
            zardosht Zardosht Kasheff
            Votes:
            1 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: