Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

  1. A process whose leader election instance indicates that it is the leader will
    1. the epoch, e, of its highest lastZxid;
    2. increment e;
    3. start accepting connections from followers;
  2. Followers open a TCP connection to a leader that their instance of the leader election indicates and send FOLLOWER(lastZxid).
  3. The leader does the following with each follower that connects:
    1. sends a NEWLEADER(lastZxid);
    2. adds the follower to the list of connections to send new proposals, so while the server is performing the next steps, it is queuing up any new proposals sent to the follower.
    3. does one of the following:
      • SNAP if the follower is so far behind that it is better to do a state transfer than send missing transactions.
      • TRUNC(zxid) if the follower has transactions that the leader has chosen to skip. The leader sets zxid to the last zxid in its history for the epoch of the follower.
      • DIFF if the leader is sending transactions that the follower is missing. The leader sends missing messages to the follower.
    4. The leader queues an UPTODATE packet.
    5. The leader releases any queued messages to the follower.
  4. When the follower receives the NEWLEADER(lastZxid) message, it makes sure that the follower has at least the last epoch in its history and sends .
  5. Once the follower receives the UPTODATE message, it sends back ACK(lastZxid)
  6. Once the leader has received an acknowledgements from a quorum of followers, it takes leadership of epoch e.

...