Flavio and others, Thanks for the reply. That's what I wanted to confirm. So, if a client receives a session expiration event and then establishes a new session, it shouldn't see any ephemeral nodes created by the expired session.
Jun On Thu, Jan 26, 2017 at 1:39 AM, Flavio Junqueira <f...@apache.org> wrote: > I actually meant to say "createSession ordered after closeSession" rather > than "before". Sorry about the confusion. > > > because ZooKeeper does not necessarily guarantee a consistent view of > the data tree across all clients at any given time. > > > I know what you mean when you say this, clients do not have necessarily > the same view of the data because the servers they are connected to can be > at different points in the sequence of committed txns. However, saying that > ZK does not guarantee a consistent view isn't correct, the view of clients > is always consistent (we guarantee sequential consistency), but they aren't > necessarily the same and they don't necessarily reflect the latest > committed state. > > -Flavio > > > On 26 Jan 2017, at 02:31, Michael Han <h...@cloudera.com> wrote: > > > >>> If you ask whether the client will see its ephemerals upon creating a > > new session, then the answer is that it shouldn't because the > createSession > > txn will be ordered necessarily before the closeSession txn, which > implies > > that the client should not see the ephemerals. > > > > Second this - so *for the same client*, it should not see the ephemeral > > nodes after the new session has established, because the ordering > > guarantees of transaction, even if this client is now connecting to a new > > server. > > > > The case where ephemeral nodes that's supposed to be gone but visible > only > > apply to other clients, because ZooKeeper does not necessarily guarantee > a > > consistent view of the data tree across all clients at any given time. > > > > On Wed, Jan 25, 2017 at 4:19 PM, Flavio Junqueira <f...@apache.org> > wrote: > > > >> Hey Jun, > >> > >> The way you're phrasing the question is problematic. Receiving a session > >> expiration means that a closeSession has been committed, so a quorum has > >> seen the closeSession event. However, a minority might still think the > >> session is up, so if you ask whether the ephemerals are still there at > the > >> "time" the client receives the session expiration event, then the > answer is > >> that it depends on which server you're talking to, one of the majority > or > >> one of the minority. > >> > >> If you ask whether the client will see its ephemerals upon creating a > new > >> session, then the answer is that it shouldn't because the createSession > txn > >> will be ordered necessarily before the closeSession txn, which implies > that > >> the client should not see the ephemerals. > >> > >> -Flavio > >> > >> > >>> On 25 Jan 2017, at 16:53, Jun Rao <jun...@gmail.com> wrote: > >>> > >>> Hi, > >>> > >>> Does ZK guarantee that ephemeral nodes from a client are removed on the > >>> sever by the time the client receives a session expiration event? I am > >>> getting conflicting info on this ( > >>> https://issues.apache.org/jira/browse/KAFKA-4277). Could someone > >> clarify? > >>> > >>> Thanks, > >>> > >>> Jun > >> > >> > > > > > > -- > > Cheers > > Michael. > >