You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2014/10/25 21:30:46 UTC

svn commit: r1634246 - in /lucene/dev/branches/branch_5x: ./ solr/ solr/core/ solr/core/src/test/org/apache/solr/cloud/ solr/solrj/ solr/solrj/src/java/org/apache/solr/common/cloud/

Author: shalin
Date: Sat Oct 25 19:30:45 2014
New Revision: 1634246

URL: http://svn.apache.org/r1634246
Log:
SOLR-6591: Overseer can use stale cluster state and lose updates for collections with stateFormat > 1

Added:
    lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/SimpleCollectionCreateDeleteTest.java
      - copied unchanged from r1634243, lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/SimpleCollectionCreateDeleteTest.java
Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/solr/   (props changed)
    lucene/dev/branches/branch_5x/solr/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/branch_5x/solr/core/   (props changed)
    lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java
    lucene/dev/branches/branch_5x/solr/solrj/   (props changed)
    lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java

Modified: lucene/dev/branches/branch_5x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/CHANGES.txt?rev=1634246&r1=1634245&r2=1634246&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_5x/solr/CHANGES.txt Sat Oct 25 19:30:45 2014
@@ -240,6 +240,9 @@ Bug Fixes
 
 * SOLR-6647: Bad error message when missing resource from ZK when parsing Schema (janhoy)
 
+* SOLR-6591: Overseer can use stale cluster state and lose updates for collections
+  with stateFormat > 1. (shalin)
+
 Optimizations
 ----------------------
 

Modified: lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java?rev=1634246&r1=1634245&r2=1634246&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java Sat Oct 25 19:30:45 2014
@@ -1039,18 +1039,9 @@ public class CollectionsAPIDistributedZk
                 "conf1");
             
             // remove collection
-            ModifiableSolrParams params = new ModifiableSolrParams();
-            params.set("action", CollectionAction.DELETE.toString());
-            params.set("name", collectionName);
-            QueryRequest request = new QueryRequest(params);
-            request.setPath("/admin/collections");
-            
-            if (client == null) {
-              client = createCloudClient(null);
-            }
-            
-            client.request(request);
-            
+            CollectionAdminRequest.Delete delete = new CollectionAdminRequest.Delete();
+            delete.setCollectionName(collectionName);
+            client.request(delete);
           } catch (SolrServerException e) {
             e.printStackTrace();
             throw new RuntimeException(e);

Modified: lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java?rev=1634246&r1=1634245&r2=1634246&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java (original)
+++ lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java Sat Oct 25 19:30:45 2014
@@ -876,8 +876,15 @@ public class ZkStateReader implements Cl
   public void removeZKWatch(final String coll) {
     synchronized (this) {
       watchedCollections.remove(coll);
-      clusterState = clusterState.copyWith(Collections
-          .<String,DocCollection> singletonMap(coll, null));
+      watchedCollectionStates.remove(coll);
+      try {
+        updateClusterState(true);
+      } catch (KeeperException e) {
+        log.error("Error updating state",e);
+      } catch (InterruptedException e) {
+        log.error("Error updating state",e);
+        Thread.currentThread().interrupt();
+      }
     }
   }