Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Zookeeper, mail # dev - Re: Review Request 12983: ZOOKEEPER-1691


Copy link to this message
-
Re: Review Request 12983: ZOOKEEPER-1691
Helen Hastings 2013-10-01, 04:02


> On Aug. 30, 2013, 11:11 a.m., Alexander Shraer wrote:
> > http://svn.apache.org/repos/asf/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/FastLeaderElection.java, line 932
> > <https://reviews.apache.org/r/12983/diff/3/?file=342268#file342268line932>
> >
> >     Can you please explain why termPredicate doesn't work in this case, requiring this fix ?
> >    
> >     Where do you check that 2 out of 2 are following the same leader ?
> >    
> >     Intuitively I would prefer to understand why termpredicate doesn't work for the case of 2 and whether we can fix it or "containsQuorum" in the quorum verifiers implementations.

This was subtle and took me a long time to figure out.  Here are the conditions in which this code caused a problem before I changed it:  A single server is running by itself in quorum mode. A second server starts with the configuration including both itself and the running server.  The second server is not able to start and leave LOOKING mode.  This is because of the line "self.getQuorumVerifier().containsQuorum(set);" within termPredicate.  The quorumVerifier for the server that is starting up contains two elements, and "set" contains one element because the starting up server will only receive one external vote.  This is fine for the case of 2/3 or 3/4 because they are all still majorities, but it will not work for 1/2.  Maybe there should be a fix within termPredicate instead of LookForLeader?
- Helen
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/12983/#review25790
-----------------------------------------------------------
On Aug. 21, 2013, 10:11 p.m., Helen Hastings wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/12983/
> -----------------------------------------------------------
>
> (Updated Aug. 21, 2013, 10:11 p.m.)
>
>
> Review request for zookeeper and Alexander Shraer.
>
>
> Repository: zookeeper
>
>
> Description
> -------
>
> Added standaloneEnabled flag to QuorumPeerConfig to give the option to disable standalone mode for a single server.
>
>
> Diffs
> -----
>
>   http://svn.apache.org/repos/asf/zookeeper/trunk/src/docs/src/documentation/content/xdocs/zookeeperAdmin.xml 1516310
>   http://svn.apache.org/repos/asf/zookeeper/trunk/src/java/main/org/apache/zookeeper/cli/ReconfigCommand.java 1516310
>   http://svn.apache.org/repos/asf/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/PrepRequestProcessor.java 1516310
>   http://svn.apache.org/repos/asf/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/FastLeaderElection.java 1516310
>   http://svn.apache.org/repos/asf/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/FollowerZooKeeperServer.java 1516310
>   http://svn.apache.org/repos/asf/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/LeaderZooKeeperServer.java 1516310
>   http://svn.apache.org/repos/asf/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java 1516310
>   http://svn.apache.org/repos/asf/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java 1516310
>   http://svn.apache.org/repos/asf/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerTestBase.java 1516310
>   http://svn.apache.org/repos/asf/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/StandaloneDisabledTest.java PRE-CREATION
>   http://svn.apache.org/repos/asf/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ReconfigTest.java 1516310
>   http://svn.apache.org/repos/asf/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/StandaloneTest.java 1516310
>
> Diff: https://reviews.apache.org/r/12983/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Helen Hastings
>
>