Matthew MacGregor
Matthew MacGregor

Reputation: 1

Is the deletion of multiple ephemeral nodes attached to a single session atomic in Zookeeper?

I know that individual write operation is atomic in Zookeeper, since they all go through the current leader node. This includes operations that delete nodes.

But when it comes to ephemeral nodes being deleted after a session expiration, do they all get deleted as part of "one" atomic operation, or are the deleted one-by-one.

To break it down with a sample scenario, lets have two clients communicating with Zookeeper, client 1 and client 2.

  1. Client 1 creates two persistent nodes, /nodes1 and /nodes2.
  2. Client 1 creates two ephemeral nodes, /nodes1/A and /nodes2/B.
  3. Client 2 places a getChildren watch on both /nodes1 and /nodes2.
  4. Client 1 disconnects and its session expires.

My question is: Is it possible that Client 2 could see some state where /nodes1/A has been deleted but /nodes2/B has yet to be deleted?

I did try looking through the documentation, but I could find anything explicitly mentioning this scenario.

All I could find was the statement: "At session expiration the cluster will delete any/all ephemeral nodes owned by that session and immediately notify any/all connected clients of the change" but that doesn't guarantee that its impossible for other connected clients to see some intermediate undefined state."

Upvotes: 0

Views: 11

Answers (0)

Related Questions