Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-4883

Rollover leader epoch when counter part of zxid reach limit

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • server

    Description

      Currently, zxid rollover will cause re-election(ZOOKEEPER-1277) which is time consuming.

      ZOOKEEPER-2789 proposes to use 24 bits for epoch and 40 bits for counter. I do think it is promising as it promotes rollover rate from 49.7 days to 34.9 years assuming 1k/s ops.

      But I think it is a one-way ticket. And the change of data format may require community wide spread to upgrade third party libraries/tools if they are ever tied to this. Inside ZooKeeper, `accepetedEpoch` and `currentEpoch` are tied to `zxid`. Given a snapshot and a txn log, we need probably deduced those two epoch values to join quorum.

      So, I presents alternative solution to rollover leader epoch when counter part of zxid reach limit.

      1. Treats last proposal of an epoch as rollover proposal.
      2. Requests from next epoch are proposed normally.
      3. Fences next epoch once rollover proposal persisted.
      4. Proposals from next epoch will not be written to disk before rollover committed.
      5. Leader commits rollover proposal once it get quorum ACKs.
      6. Blocked new epoch proposals are logged once rollover proposal is committed in corresponding nodes.
         
        This results in:
      1. No other lead cloud lead using next epoch number once rollover proposal is considered committed.
      2. No proposals from next epoch will be written to disk before rollover proposal is considered committed.

      Here is the branch, I will draft a pr later.

      https://github.com/kezhuw/zookeeper/tree/zxid-rollover

      Attachments

        Issue Links

          Activity

            People

              kezhuw Kezhu Wang
              kezhuw Kezhu Wang
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m