Zookeeper medium
A client loses its network connection for 2 seconds in an environment with a 10-second `sessionTimeout`. What is the immediate fate of the client's Ephemeral nodes during this 'blip'?
- A They are purged immediately to prevent stale data from being served by the remaining cluster members.
- B They remain alive. The Ephemeral nodes are only deleted if the cumulative disconnection time exceeds the negotiated `sessionTimeout`.
- C They are temporarily renamed with a `.tmp` suffix and moved to a dedicated 'reclamation' Znode.
- D They are converted into persistent nodes to ensure high availability of the client's state during the outage.
Answer: B. They remain alive. The Ephemeral nodes are only deleted if the cumulative disconnection time exceeds the negotiated `sessionTimeout`.
This distinguishes a 'blip' from a 'crash'. The system tolerates network instability. The client has a grace period (10s) to reconnect to *any* node in the cluster to renew the session before data is lost.
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?