Flavio Paiva Junqueira commented on ZOOKEEPER-261:

I think I agree with the proposal, but I'm not sure yet because it is not clear 
to me if it is being proposed to have leader election handling an exceptional 
case, and to me it looks like this is not necessary.

If we have the ability to determine that state is corrupt, has been reset, or 
has mysteriously disappeared, then shouldn't we simply reset the whole server 
and start from scratch? If that's the case, then we just have to reset the 
server's last zxid, and let it participate in the leader election without 
having to handle exceptional cases. Such a server won't win the leader election 
if there is another server that has accepted some zxid > 0. Otherwise, the one 
with highest id will be selected.

>From the current implementation, FileTxnLog.getLastLoggedZxid() will return -1 
>already if the transaction log is empty, right? If this is correct, then it 
>looks like we don't need to do anything. 

> Reinitialized servers should not participate in leader election
> ---------------------------------------------------------------
>                 Key: ZOOKEEPER-261
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-261
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: leaderElection, quorum
>            Reporter: Benjamin Reed
> A server that has lost its data should not participate in leader election 
> until it has resynced with a leader. Our leader election algorithm and 
> NEW_LEADER commit assumes that the followers voting on a leader have not lost 
> any of their data. We should have a flag in the data directory saying whether 
> or not the data is preserved so that the the flag will be cleared if the data 
> is ever cleared.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

Reply via email to