Most probably we shouldn't explicitly state the increment count but that
it will increase. Also is there a rest/overflow condition ?
|From: Patrick Hunt [mailto:ph...@apache.org]
|Sent: Friday, December 12, 2008 2:24 PM
|To: Mahadev Konar
|Subject: Re: zoo_set() version question
|That's fine, but we should document it. Please enter a JIRA that the
|docs should talk about this.
|I notice we have this in the prog guide:
|"Each time a znode's data changes, the version number increases."
|Sort of a moot point once we fix the zoo_set api but we should
|explicitly state that it increments by 1.
|Mahadev Konar wrote:
|> That's right pat. I thought about that. Though ben already mentioned
|> missed the stat return in the c sync code.
|> But for the version, since its a test and set, we should also
|> the version is a +1 to prev one. It would be really unintutive if it
|> Also I noticed after ben's comments that the async callback
|> called back with stat argument. Only the zoo_get() sync api is
|> return code :).
|> On 12/12/08 12:39 PM, "Patrick Hunt" <ph...@apache.org> wrote:
|>> Mahadev Konar wrote:
|>>> And you have a success, then the version of the node that denots
|>>> successful zoo_set() above is
|>>> = Version +1
|>> Mahadev, that's the current implementation, but I wasn't aware we
|>> exposing that detail as something users should rely on. Is it
|>> anywhere in the docs? If this is "user visible" we should document
|>> thought we weren't exposing this for a reason...
|>>> On 12/12/08 11:36 AM, "Avery Ching" <ach...@yahoo-inc.com> wrote:
|>>>> Thanks for responding.
|>>>> I agree that I can use zoo_exists and zoo_get to get the version
|>>>> znode as it exists currently.
|>>>> The problem I am trying to solve is that getting the version from
|>>>> Stat in either zoo_exists or zoo_get may not be the same version
|>>>> last successful zoo_set used. I would like to get the version
|>>>> my last successful zoo_set() operation to a particular znode.
|>>>> I understand that the data and version to the znode may change
|>>>> one or multiple times after my zoo_set() and this is fine, but I
|>>>> like to know the znode's versions of the data I set.
|>>>> On 12/12/08 11:11 AM, "Patrick Hunt" <ph...@apache.org> wrote:
|>>>>> Avery Ching wrote:
|>>>>>> If zoo_set() completes successfully with version != -1, can we
|>>>>>> version -> version + 1 for this znode? If not, is there a way
|>>>>>> to get the version of the successfully completed zoo_set()
|>>>>> 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
|>>>>> node immediately after you change it.
|>>>>> You can access the version using zoo_exists or zoo_get -
|>>>>> the "struct Stat stat" argument of either of those methods
|>>>>> "version" member.