Zookeeper medium
A ZooKeeper Transaction ID (zxid) is a 64-bit integer. What is the architectural role of the upper 32-bits during a leader election process?
- A They represent the Epoch (Leader Era); this allows the ensemble to distinguish and invalidate commands from stale leaders.
- B They store the physical MAC addresses of the nodes participating in the current atomic broadcast quorum.
- C They represent the precise nanosecond timestamp of when the transaction was first accepted by the followers.
- D They act as a secondary cryptographic signature to verify the integrity of the Znode metadata tree.
Answer: A. They represent the Epoch (Leader Era); this allows the ensemble to distinguish and invalidate commands from stale leaders.
When a new Leader is elected, the Epoch increments (Upper 32 bits), and the counter resets. This allows ZK to easily determine which data is newer (Higher Epoch wins).
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?