Just in case anyone interested in this conversion might miss an important fact not explicitly mentioned here: any EPHEMERAL nodes will be deleted on session expire (guaranteed by ZK). This makes the 'fact' I mentioned above reliable, I guess.
On Tue, Mar 11, 2014 at 12:00 AM, chao chu <[email protected]> wrote: > Um, just my personal thoughts. As I understand, I think we are relying on > the fact that: at any time, the latch who created the lowerest number znode > on the leader election node path is determinted as the leader (this is > exactly how the checkLeadership identify the current leader). > > Otherwise, at least for LeaderLatch, we lose the advantage to have the > distinguish between ConnectionLossException and SessionExpiredExpection. > > > On Mon, Mar 10, 2014 at 11:44 PM, Jordan Zimmerman < > [email protected]> wrote: > >> Sorry for being dense here, but my point is that: Suppose the leader >> latch does NOT setLeadership(false) on receiving SUSPENDED, then what you >> mentioned below won't happen, right? >> >> If the latch does't set false then it is lying. When there is a network >> partition it is impossible to know the state of the cluster. The only safe >> thing to do is assume that you are no longer leader (no longer hold the >> lock, etc.). >> >> -JZ >> > > > > -- > ChuChao > -- ChuChao
