zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Hunt <ph...@apache.org>
Subject Re: znode cversion decreasing?
Date Mon, 12 Apr 2010 05:59:43 GMT
Hi Kevin,

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 
with debugging.


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
> decreasing.
> Am I misunderstanding something about the way node version numbers work?
> Is there a better/recommended way to implement a monotonically
> increasing group number?
> Thanks!
> Kevin
> [1] http://hadoop.apache.org/zookeeper/docs/r3.2.2/recipes.html
> [2]
> http://eng.kaching.com/2010/01/actually-implementing-group-management.html

View raw message