zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shelley, Ryan" <Ryan.Shel...@disney.com>
Subject Re: Create nested paths
Date Thu, 01 Mar 2012 18:46:23 GMT
Perfect. Thanks so much!

On 3/1/12 10:15 AM, "Marshall McMullen" <marshall.mcmullen@gmail.com>
wrote:

>Check() will check if it exists with the specified version number. If you
>give it -1 it won't compare the version number. So that's a basic Exists()
>call. Does that make sense?
>
>On Thu, Mar 1, 2012 at 6:13 PM, Shelley, Ryan
><Ryan.Shelley@disney.com>wrote:
>
>> I don't see an Op.exists() method. Check, Create, Delete and SetData.
>>I'm
>> on 3.4.3, if that makes a difference.
>>
>> On 2/29/12 7:16 PM, "Ted Dunning" <ted.dunning@gmail.com> wrote:
>>
>> >On Wed, Feb 29, 2012 at 7:04 PM, Marshall McMullen <
>> >marshall.mcmullen@gmail.com> wrote:
>> >
>> >> Yes, Ted's right. The multi has to fail as that's part of the
>>contract
>> >>it
>> >> guarantees.
>> >>
>> >> The only thing you could do, which will significantly narrow the race
>> >> condition, is as you're *building *the multi, check if the path
>>already
>> >> exists. If so, then don't add the create op for that path into the
>> >>multi.
>> >> Of course this may not work in every situation, but we use that
>> >>approach in
>> >> many code paths and it works well.
>> >>
>> >
>> >Another approach is to compose one multi with Op.exists() for each
>>level
>> >so
>> >that you find everything you need, then create another with the correct
>> >Op.create() operations.  That gets the problem down to two server
>> >round-trips but still has the race condition.
>>
>>


Mime
View raw message