Zookeeper medium
During the recovery of a ZooKeeper node, how does the system interact with Transaction Logs and Snapshots to rebuild its in-memory state?
- A It ignores the log and only loads the latest Snapshot, as snapshots are guaranteed to be fully atomic and consistent.
- B It loads the most recent 'Fuzzy Snapshot' and then replays all Transaction Log entries recorded *after* that snapshot point to reach consistency.
- C It performs a global checksum validation against the leader node and discards all local disk-persisted state.
- D It loads the entire transaction log into a secondary buffer and performs a reverse-diff comparison against the OS filesystem metadata.
Answer: B. It loads the most recent 'Fuzzy Snapshot' and then replays all Transaction Log entries recorded *after* that snapshot point to reach consistency.
Snapshots in ZK are 'fuzzy' (taken while changes are happening, so they might be inconsistent). The Transaction Log is the source of truth used to repair the snapshot.
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?