[sheepdog] [PATCH 1/2] zookeeper: remove master from zookeeper
Kai Zhang
kyle at zelin.io
Thu Aug 8 08:47:57 CEST 2013
On Aug 8, 2013, at 2:37 PM, MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp> wrote:
> At Thu, 8 Aug 2013 10:20:50 +0800,
> Kai Zhang wrote:
>>
>>
>> On the second thought, as I browse the code in zookeeper recipes, I think the
>> code is not strong enough.
>> For example, the lock function is based on creating sequence znode. However,
>> if error occurs during the creation, it is not easy to retry it. And the code in
>> the recipes didn't handle it at all.
>> (The code I found is in version 3.4.5, seems the logic in the code is not same as
>> described in the website).
>>
>> I would suggest that we use a little number for sleeping, e.g. 50ms.
>> And check the existence before creating the lock znode.
>> (checking existence is much cheeper than creating)
>>
>> This may be simple but not the best choice.
>> If it is a big issue in production, I think we can make it better later in other way.
>
> Looks good to me.
Thanks, I will update and send version 2 soon.
Thanks,
Kyle
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/sheepdog/attachments/20130808/356a0cf3/attachment-0004.html>
More information about the sheepdog
mailing list