ZAB

Guarantees

Steps of ZAB

  1. Discovery (Finding a leader)

    1. Followers send last proposed epoch to leader.
    2. The leader gets last accepted epoch, and sends a new epoch which is max(epochs) + 1.
    3. If followers agree, then folloewrs update epoch and send ACK. If not, repeat step 1.
    4. Follower with highest zxid becomes leader
  2. Synchronization (Gaining consensus for all followers)

    1. The follower with the highest zxid becomes leader, and waits for ACK from quorom.
    2. Followers do curr_epoch - prev_epoch and issue a DIFF call for missing transactions to synchronize.
    3. Leader sends DIFFs to followers as necessary. This is appended in WAL before being ACKed.
  3. Broadcast (Accepting new transactions)

    1. Leader proposes new zxid of max(epochs) + 1.
    2. Leader broadcasts new zxid, and followers append to WAL. Followers respond with ACK.
    3. Leader sends a commit message to followers when it receives ACK from quorom.
    4. Followers broadcast the transactions amongst each other.