Zookeeper easy
How does ZooKeeper reliably determine if a connected client session is still active?
- A The client must perform at least one write operation every 60 seconds.
- B Via periodic 'Heartbeats'; if the server misses them within the timeout window, the session is expired.
- C The server uses a TCP port scan to verify the client's listening socket is open.
- D It relies on the underlying OS filesystem locks to track client residency.
Answer: B. Via periodic 'Heartbeats'; if the server misses them within the timeout window, the session is expired.
The session is the context for Ephemeral nodes. If the heartbeats stop (due to network failure or client crash), the session expires and the ephemeral nodes are removed.
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?