zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mic...@apache.org
Subject svn commit: r1583509 - in /zookeeper/trunk: CHANGES.txt src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java
Date Tue, 01 Apr 2014 01:45:52 GMT
Author: michim
Date: Tue Apr  1 01:45:52 2014
New Revision: 1583509

URL: http://svn.apache.org/r1583509
Log:
ZOOKEEPER-1701. When new and old config have the same version, no need to write new config
to disk or create new connections (Alexander Shraer via michim)

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

Modified: zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/trunk/CHANGES.txt?rev=1583509&r1=1583508&r2=1583509&view=diff
==============================================================================
--- zookeeper/trunk/CHANGES.txt (original)
+++ zookeeper/trunk/CHANGES.txt Tue Apr  1 01:45:52 2014
@@ -829,6 +829,10 @@ IMPROVEMENTS:
   ZOOKEEPER-1728. Better error message when reconfig invoked in standalone mode
   (Alexander Shraer via michim)
 
+  ZOOKEEPER-1701. When new and old config have the same version, no need to
+  write new config to disk or create new connections (Alexander Shraer via
+  michim)
+
 headers
 
 Release 3.4.0 - 

Modified: zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java?rev=1583509&r1=1583508&r2=1583509&view=diff
==============================================================================
--- zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java (original)
+++ zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java Tue Apr
 1 01:45:52 2014
@@ -1267,11 +1267,17 @@ public class QuorumPeer extends ZooKeepe
     }
     
     public synchronized void setLastSeenQuorumVerifier(QuorumVerifier qv, boolean writeToDisk){
-        if (lastSeenQuorumVerifier!=null && lastSeenQuorumVerifier.getVersion() >=
qv.getVersion()) {
-           LOG.warn("setLastSeenQuorumVerifier called with stale config " + qv.getVersion()
+ 
+        if (lastSeenQuorumVerifier!=null && lastSeenQuorumVerifier.getVersion() >
qv.getVersion()) {
+           LOG.error("setLastSeenQuorumVerifier called with stale config " + qv.getVersion()
+ 
                    ". Current version: " + quorumVerifier.getVersion());
           
         }
+        // assuming that a version uniquely identifies a configuration, so if
+        // version is the same, nothing to do here.
+        if (lastSeenQuorumVerifier != null &&
+            lastSeenQuorumVerifier.getVersion() == qv.getVersion()) {
+            return;
+        }
         lastSeenQuorumVerifier = qv;
         connectNewPeers();
         if (writeToDisk) {



Mime
View raw message