[ https://issues.apache.org/jira/browse/ZOOKEEPER-1932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15999248#comment-15999248 ]
ASF GitHub Bot commented on ZOOKEEPER-1932: ------------------------------------------- Github user arshadmohammad commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/106#discussion_r115111914 --- Diff: src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java --- @@ -930,39 +918,36 @@ protected Election createElectionAlgorithm(int electionAlgorithm){ //TODO: use a factory rather than a switch switch (electionAlgorithm) { - case 0: - le = new LeaderElection(this); - break; - case 1: - le = new AuthFastLeaderElection(this); - break; - case 2: - le = new AuthFastLeaderElection(this, true); - break; - case 3: - qcm = new QuorumCnxManager(this); - QuorumCnxManager.Listener listener = qcm.listener; - if(listener != null){ - listener.start(); - FastLeaderElection fle = new FastLeaderElection(this, qcm); - fle.start(); - le = fle; - } else { - LOG.error("Null listener when initializing cnx manager"); - } - break; - default: - assert false; + case 0: + assert false : "Leader election algorithm type 0 is not supported anymore."; + break; + case 1: + le = new AuthFastLeaderElection(this); + break; + case 2: + le = new AuthFastLeaderElection(this, true); + break; + case 3: + qcm = new QuorumCnxManager(this); + QuorumCnxManager.Listener listener = qcm.listener; + if(listener != null){ + listener.start(); + FastLeaderElection fle = new FastLeaderElection(this, qcm); + fle.start(); + le = fle; + } else { + LOG.error("Null listener when initializing cnx manager"); + } + break; + default: + assert false; } return le; } @SuppressWarnings("deprecation") protected Election makeLEStrategy(){ LOG.debug("Initializing leader election protocol..."); - if (getElectionType() == 0) { - electionAlg = new LeaderElection(this); - } return electionAlg; } --- End diff -- org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseDynamicConfig(Properties, int, boolean, boolean) has a logic related to election algo type 0. This should be removed > org.apache.zookeeper.test.LETest.testLE fails once in a while > ------------------------------------------------------------- > > Key: ZOOKEEPER-1932 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1932 > Project: ZooKeeper > Issue Type: Bug > Components: leaderElection > Affects Versions: 3.5.0 > Reporter: Michi Mutsuzaki > Assignee: Michael Han > Fix For: 3.6.0 > > Attachments: TEST-org.apache.zookeeper.test.LETest.txt, > ZOOKEEPER-1932.patch, ZOOKEEPER-1932.patch > > > org.apache.zookeeper.test.LETest.testLE is failing on trunk once in a while. > I'm not able to reproduce the failure on my box. I looked at the log, but I > couldn't quite figure out what's going on. > https://builds.apache.org/view/S-Z/view/ZooKeeper/job/ZooKeeper-trunk/2315/testReport/ -- This message was sent by Atlassian JIRA (v6.3.15#6346)