zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Hunt <ph...@apache.org>
Subject Re: zoo_set() version question
Date Fri, 12 Dec 2008 19:11:01 GMT
Avery Ching wrote:
> If zoo_set() completes successfully with version != -1, can we assume that
> version -> version + 1 for this znode?  If not, is there a way for the user
> to get the version of the successfully completed zoo_set() operation?

You shouldn't rely on this, it may work, but it's not part of the 
contract. Also, nothing says that some other client won't change the 
node immediately after you change it.

You can access the version using zoo_exists or zoo_get - specifically 
the "struct Stat stat" argument of either of those methods contains a 
"version" member.

Patrick

Mime
View raw message