Lakshmi Manasa
Lakshmi Manasa

Reputation: 13

Zookeeper ephemeral node creation order

Is there a guarantee provided by zookeeper about the order of ephemeral node creation?

Consider the following scenario:

  1. P1 creates an ephemeral node at time t1 at path "proc" resulting in "proc/p1"
  2. P2 creates another ephemeral node at time t2 (after t1) at path "proc" resulting in proc/p2

My question: is the structure guaranteed to be Structure 1:

Proc

|__ p1

|__ p2

or could it also be Structure 2:

Proc

|__ p2

|__ p1

I have looked through the Zookeeper docs and while it clearly explains ephemeral nodes and how they get deleted at end/expiry of a session. There is no mention about the order of creation of these nodes.

Any help would be much appreciated. thanks!

Upvotes: 0

Views: 117

Answers (1)

Jacky Wang
Jacky Wang

Reputation: 3490

The creation order of ephemeral nodes is decided by the arrival time to ZK server of the requests, not the send time.

Upvotes: 0

Related Questions