If it is the same session that it connect to another server, I believe the answer is yes. If the old session is expired and a new session is create, the watch not get the event. You need to set watch with new session, and those calls will return the changed data/state. So you need to process those in your reconnect logic. A tip: do not keep whole data or children, just the version or cversion.
-----邮件原件----- 发件人: iamct [mailto:[email protected]] 发送时间: 2012年6月4日 22:46 收件人: [email protected] 主题: Re: when the zookeeper Expired ,may I have to rebuild the watch on a znode? Thank you! I have another question。 I set a watch on one znode。 A change happen,the service my client had connected sent the packet ,but this time,my client becomes partitioned from the ZK serving cluster。 When my session reconnect,may I get the event? I think it is not。 but in the http://zookeeper.apache.org/doc/current/zookeeperProgrammers.html#ch_zkWatches said : ZooKeeper provides an ordering guarantee: a client will never see a change for which it has set a watch until it first sees the watch event. -- View this message in context: http://zookeeper-user.578899.n2.nabble.com/when-the-zookeeper-Expired-may-I-have-to-rebuild-the-watch-on-a-znode-tp7577513p7577520.html Sent from the zookeeper-user mailing list archive at Nabble.com.
