[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13532680#comment-13532680
 ] 

Edward Ribeiro commented on ZOOKEEPER-1404:
-------------------------------------------

Sorry, I read quickly and forgot that "j < i and n_j is a znode in C" while 
writing my comment.
                
> leader election pseudo code probably incorrect
> ----------------------------------------------
>
>                 Key: ZOOKEEPER-1404
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1404
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: documentation
>    Affects Versions: 3.4.3
>            Reporter: Robert Varga
>
> The pseudo code for leader election in the recipes.html page of 3.4.3 
> documentation is the following...
> {quote}
> Let ELECTION be a path of choice of the application. To volunteer to be a 
> leader: 
> 1.Create znode z with path "ELECTION/guid-n_" with both SEQUENCE and 
> EPHEMERAL flags;
> 2.Let C be the children of "ELECTION", and i be the sequence number of z;
> 3.Watch for changes on "ELECTION/guid-n_j", where j is the 
> {color:red}*smallest*{color} sequence number such that j < i and n_j is a 
> znode in C;
> Upon receiving a notification of znode deletion: 
> 1.Let C be the new set of children of ELECTION; 
> 2.If z is the smallest node in C, then execute leader procedure;
> 3.Otherwise, watch for changes on "ELECTION/guid-n_j", where j is the 
> {color:red}*smallest*{color} sequence number such that j < i and n_j is a 
> znode in C; 
> {quote}
> I think, in both third steps *highest* should appear instead of 
> {color:red}*smallest*{color}.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to