The server increments a znode's cversion by one each time a change to
it's child list is made. Every znode has it's own cversion. It should
never decrease. If you delete a znode and create it a new then the
cversion is reset for that znode. The cversion also happens to be used
for the sequence number. Are you using the c or java client? Is this
always happening or just in some cases? reproduceable? You might try
creating your ephemerals with the sequence flag, then comparing the
cversion of the parent with the sequence number assigned - might help
On 04/11/2010 03:53 PM, Kevin Webb wrote:
I'm using Zookeeper (3.2.2) for a simple group membership service in
the manner that is typically described[1,2]:
I create a znode for the group, and each present group member adds an
ephemeral node under the group node. I'm using the cversion of the group
node as a "group number". I expected this value to be monotonically
increasing, but I'm seeing instances where this isn't the case.
According to the programmer's guide, changes to a node will cause the
appropriate version number to increase, but it says nothing about
Am I misunderstanding something about the way node version numbers work?
Is there a better/recommended way to implement a monotonically
increasing group number?