hadoop-zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r995845 - in /hadoop/zookeeper/trunk: CHANGES.txt src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java
Date Fri, 10 Sep 2010 16:13:11 GMT
Author: breed
Date: Fri Sep 10 16:13:11 2010
New Revision: 995845

URL: http://svn.apache.org/viewvc?rev=995845&view=rev
Log:
ZOOKEEPER-785. Zookeeper 3.3.1 shouldn't infinite loop if someone creates a server.0 line

Modified:
    hadoop/zookeeper/trunk/CHANGES.txt
    hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java

Modified: hadoop/zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/CHANGES.txt?rev=995845&r1=995844&r2=995845&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/CHANGES.txt (original)
+++ hadoop/zookeeper/trunk/CHANGES.txt Fri Sep 10 16:13:11 2010
@@ -88,6 +88,7 @@ BUGFIXES: 
 
   ZOOKEEPER-867. ClientTest is failing on hudson - fd cleanup (phunt)
 
+  ZOOKEEPER-785. Zookeeper 3.3.1 shouldn't infinite loop if someone creates a server.0 line
(phunt and Andrei Savu via breed)
 
 IMPROVEMENTS:
   ZOOKEEPER-724. Improve junit test integration - log harness information 

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java?rev=995845&r1=995844&r2=995845&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java
(original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java
Fri Sep 10 16:13:11 2010
@@ -243,7 +243,14 @@ public class QuorumPeerConfig {
             throw new IllegalArgumentException(
                     "minSessionTimeout must not be larger than maxSessionTimeout");
         }
-        if (servers.size() > 1) {
+        if (servers.size() == 1) {
+            LOG.error("Invalid configuration, only one server specified (ignoring)");
+            servers.clear();
+        } else if (servers.size() > 1) {
+            if (servers.size() == 2) {
+                LOG.warn("No server failure will be tolerated. " +
+                    "You need at least 3 servers.");
+            }
             if (initLimit == 0) {
                 throw new IllegalArgumentException("initLimit is not set");
             }



Mime
View raw message