zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vazhenin, Maksim" <Maksim.Vazhe...@dell.com>
Subject ephemeral nodes. atomic invalidation on session expiration?
Date Fri, 02 Dec 2016 11:59:31 GMT

Could you please clarify expected behavior in the following case:
1. Client connects to zk and creates ephemeral nodes /n1 and /n2 (using session1).
2. Client dies.
3. Client connects with new session to zk before  session1 expired.
4. Client checks if /n1 exists and waits till it dies.
5. Is it guaranteed that /n2 will also be dead at this point? Or /n2 could still be alive
(waiting till zk server)?

In other words does zk invalidates ephemeral nodes for a session atomically or not? (If it
is not atomic then during some short time client could see part of ephemeral nodes removed
and part of them still present for expired session?)

It is not clear from the documentation:
"ZooKeeper also has the notion of ephemeral nodes. These znodes exists as long as the session
that created the znode is active. When the session ends the znode is deleted. Because of this
behavior ephemeral znodes are not allowed to have children."

If this happens not atomically, what is the correct timeout client need to wait to ensure
that all ephemeral nodes from its previous session are removed? (sessionTimeout which client
sent in request when creating session? )

Thanks in advance,
View raw message