curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jordan Zimmerman <>
Subject Re: Code question in LeaderLatch
Date Mon, 22 Jul 2019 14:25:28 GMT
The reasoning is lost to history I think. Looking at it now it could likely just call "getChildren()"
like the watcher above it. That said, I'd be loathe to make changes in such an old and widely
used class. We'd have to do copious testing on it.


> On Jul 22, 2019, at 4:44 AM, Zili Chen <> wrote:
> Hi Curators,
> I am reading the source code and in LeaderLatch#L592-603 it confuses
> me that when we find the previous node gone, we reset to create a new
> ephemeral sequential node for contending leadership.
> My question is, supposed ourPath is latch-n2 and the previous node path
> is latch-n1 where n1 is the largest number such that n1 < n2, if
> latch-n1 gone, why not just call getChildren to check if n2 is the
> leader or register another watch but we reset to create a new node?
> Best,
> tison.

View raw message