Watcher guarantees
If client sets a watcher on a znode by doing a getData operation is it guaranteed to get the next change after the value it read, or can a change be missed? In other words if the value it read had zxid z1 and the next update of the znode has zxid z2, will the watcher always get the event for the change z2? Thanks, Tom
Re: Watcher guarantees
Tom White wrote: If client sets a watcher on a znode by doing a getData operation is it guaranteed to get the next change after the value it read, or can a change be missed? In other words if the value it read had zxid z1 and the next update of the znode has zxid z2, will the watcher always get the event for the change z2? Yes, that is a strong guarantee. See the following: http://hadoop.apache.org/zookeeper/docs/r3.0.1/zookeeperProgrammers.html#sc_WatchGuarantees Patrick
Re: Watcher guarantees
If client sets a watcher on a znode by doing a getData operation is it guaranteed to get the next change after the value it read, or can a change be missed? The watch is just a notification that the node changed. If you do a getData on the node, you their might have been more updates on the node. So yes, you can miss changes. In other words if the value it read had zxid z1 and the next update of the znode has zxid z2, will the watcher always get the event for the change z2? The watcher will always get an event for zxid z2, but since the watch does not have the data with it -- it will have to do getdata for the that node. Thanks, Tom Mahadev
Re: Watcher guarantees
Thanks for your answers. I understand that you have to call getData() to find the value of the znode, and that it may have been updated between the watcher being called and the getData() call. So in that sense you can miss updates. But watches have strong enough guarantees to allow you to keep up to date with the latest value by repeatedly setting a new watch after the old one fires. The situation I was thinking about - and trying to avoid - was not being notified about z2, and having to wait for a further update z3 before the watch fired (which could be an arbitrary time later), because it somehow missed z2. Sounds like this doesn't happen. Cheers, Tom On Fri, Feb 13, 2009 at 6:21 PM, Mahadev Konar maha...@yahoo-inc.com wrote: If client sets a watcher on a znode by doing a getData operation is it guaranteed to get the next change after the value it read, or can a change be missed? The watch is just a notification that the node changed. If you do a getData on the node, you their might have been more updates on the node. So yes, you can miss changes. In other words if the value it read had zxid z1 and the next update of the znode has zxid z2, will the watcher always get the event for the change z2? The watcher will always get an event for zxid z2, but since the watch does not have the data with it -- it will have to do getdata for the that node. Thanks, Tom Mahadev
[ANNOUNCE] Apache ZooKeeper 3.1.0
The Apache ZooKeeper team is proud to announce Apache ZooKeeper version 3.1.0. ZooKeeper is a high-performance coordination service for distributed applications. It exposes common services - such as naming, configuration management, synchronization, and group services - in a simple interface so you don't have to write them from scratch. You can use it off-the-shelf to implement consensus, group management, leader election, and presence protocols. And you can build on it for your own, specific needs. Key features of the 3.1.0 release: * Quota support * BookKeeper - a system to reliably log streams of records * JMX for server management * many fixes, improvements, improved documentation, etc... A bit about BookKeeper: a system to reliably log streams of records. In BookKeeper, servers are bookies, log streams are ledgers, and each unit of a log (aka record) is a ledger entry. BookKeeper is designed to be reliable; bookies, the servers that store ledgers can be byzantine, which means that some subset of the bookies can fail, corrupt data, discard data, but as long as there are enough correctly behaving servers the service as a whole behaves correctly; the meta data for BookKeeper is stored in ZooKeeper. For ZooKeeper release details and downloads, visit: http://hadoop.apache.org/zookeeper/releases.html ZooKeeper 3.1.0 Release Notes are at: http://hadoop.apache.org/zookeeper/docs/r3.1.0/releasenotes.html Regards, The ZooKeeper Team