curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shevek (JIRA)" <>
Subject [jira] [Commented] (CURATOR-7) Session ids not preserved if EnsembleProvider has changed the ensemble
Date Thu, 28 Mar 2013 23:57:15 GMT


Shevek commented on CURATOR-7:

ZooKeeper ClientCnxn line 850:             long sessId = (seenRwServerBefore) ? sessionId
: 0;

The only person who sets seenRwServerBefore is onConnected().

Therefore, it appears that passing a sessionId into a ZooKeeper constructor has no effect,
as the ClientCnxn has never seen an RW server before, so it discards it anyway. So the ZookeeperFactory
approach won't work.
> Session ids not preserved if EnsembleProvider has changed the ensemble
> ----------------------------------------------------------------------
>                 Key: CURATOR-7
>                 URL:
>             Project: Apache Curator
>          Issue Type: Improvement
>          Components: Client
>    Affects Versions: 2.0.0
>            Reporter: Shevek
>            Assignee: Jordan Zimmerman
> See
> InterProcessMutex, LeaderLatch, etc use an ephemeral node. If ZooKeeper gives a Disconnected
event, the native client reconnects with the same session id, and the ephemeral node is preserved.
If the ensemble changes at any point before a Disconnect, Curator's ConnectionState#checkState()
calls handleNewConnectionString(), which constructs a new native ZK client, discarding the
previous session id, and losing all locks.
> This can be expensive.
> Can ConnectionState be made to preserve the session id, or be more conservative about
discarding the entire native client on a Disconnected event?
> Clarifications:
> An ensemble change (e.g. adding a new node to a cluster) does not mean that all session
ids are now invalid. The next network glitch should not break locks.
> There is no assumption in this description that the reconfiguration and the glitch/disconnection
were related - they need not be.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message