lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject svn commit: r1693251 - in /lucene/dev/trunk/solr: CHANGES.txt solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
Date Wed, 29 Jul 2015 12:44:07 GMT
Author: shalin
Date: Wed Jul 29 12:44:07 2015
New Revision: 1693251

URL: http://svn.apache.org/r1693251
Log:
SOLR-7840: ZkStateReader.updateClusterState fetches watched collections twice from ZK

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1693251&r1=1693250&r2=1693251&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Wed Jul 29 12:44:07 2015
@@ -272,7 +272,8 @@ Optimizations
   For Example: The facet request  {type:terms, field:field1, facet:{x:"unique(field2)"}}
   saw a 7x improvement when field1 and 1M unique terms and field2 had 1000 unique terms.
   (yonik)
-  
+
+* SOLR-7840: ZkStateReader.updateClusterState fetches watched collections twice from ZK.
(shalin)
 
 Other Changes
 ----------------------

Modified: lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java?rev=1693251&r1=1693250&r2=1693251&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java (original)
+++ lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java Wed
Jul 29 12:44:07 2015
@@ -428,7 +428,7 @@ public class ZkStateReader implements Cl
         if (watchedCollections.contains(s)) {
           DocCollection live = getCollectionLive(this, s);
           if (live != null) {
-            watchedCollectionStates.put(s, live);
+            updateWatchedCollection(live);
             // if it is a watched collection, add too
             result.put(s, new ClusterState.CollectionRef(live));
           }
@@ -506,15 +506,6 @@ public class ZkStateReader implements Cl
         }
         this.clusterState = clusterState;
       }
-      synchronized (ZkStateReader.this) {
-        for (String watchedCollection : watchedCollections) {
-          DocCollection live = getCollectionLive(this, watchedCollection);
-          if (live != null) {
-            updateWatchedCollection(live);
-          }
-        }
-      }
-
     } else {
       if (clusterStateUpdateScheduled) {
         log.debug("Cloud state update for ZooKeeper already scheduled");
@@ -946,9 +937,7 @@ public class ZkStateReader implements Cl
   
   private void updateWatchedCollection(DocCollection newState) {
     watchedCollectionStates.put(newState.getName(), newState);
-    log.info("Updating data for {} to ver {} ", newState.getName(),
-        newState.getZNodeVersion());
-    
+    log.info("Updating data for {} to ver {} ", newState.getName(), newState.getZNodeVersion());
     this.clusterState = clusterState.copyWith(newState.getName(), newState);
   }
   



Mime
View raw message