Zookeeper hard
The lower 32-bits of a ZooKeeper Transaction ID (zxid) are used as a counter. What happens when this counter reaches its 4 billion limit?
- A The cluster enters an emergency 'Read Only' state until the administrator manually resets the global transaction log.
- B A new Leader Election is automatically triggered to increment the Epoch (Upper 32-bits) and reset the Counter to zero.
- C The system performs a silent overflow back to zero, potentially causing data corruption due to non-monotonic order.
- D The transaction log is automatically compressed using a GZIP-based algorithm to reclaim the sequence bit-space.
Answer: B. A new Leader Election is automatically triggered to increment the Epoch (Upper 32-bits) and reset the Counter to zero.
Since the ZXID must be monotonic, you cannot wrap to 0 in the same Epoch. Changing the Epoch (Leader Cycle) is the only way to reset the counter validly.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- What is the primary technical function of a ZooKeeper 'Watch'?
- A system administrator increases `jute.maxbuffer` to 5MB on every ZooKeeper server to store large configuration objects. However, write operations larger than 1MB still fail. What is the most likely cause?
- By default, `forceSync` is enabled. If you disable it, what trade-off are you making?
- If the specific ZooKeeper node a client is connected to crashes, what should the client do?
- Which cluster configuration has *worse* availability: A 3-node cluster or a 4-node cluster? (Assuming simple majority quorum)
- According to the CAP Theorem, how is ZooKeeper classified?