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/11/03 18:30:04 UTC

svn commit: r1636400 - /lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/Overseer.java

Author: shalin
Date: Mon Nov  3 17:30:04 2014
New Revision: 1636400

URL: http://svn.apache.org/r1636400
Log:
SOLR-6591: Ignore overseer operations for collections with stateFormat > 1 if the parent ZK path doesn't exist

Modified:
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/Overseer.java

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/Overseer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/Overseer.java?rev=1636400&r1=1636399&r2=1636400&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/Overseer.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/Overseer.java Mon Nov  3 17:30:04 2014
@@ -382,6 +382,20 @@ public class Overseer implements Closeab
                 zkClient.setData(e.getKey(), data, true);
               } else {
                 log.info("going to create_collection {}", e.getKey());
+                String parentPath = e.getKey().substring(0, e.getKey().lastIndexOf('/'));
+                if (!zkClient.exists(parentPath, true)) {
+                  // if the /collections/collection_name path doesn't exist then it means that
+                  // 1) the user invoked a DELETE collection API and the OverseerCollectionProcessor has deleted
+                  // this zk path.
+                  // 2) these are most likely old "state" messages which are only being processed now because
+                  // if they were new "state" messages then in legacy mode, a new collection would have been
+                  // created with stateFormat = 1 (which is the default state format)
+                  // 3) these can't be new "state" messages created for a new collection because
+                  // otherwise the OverseerCollectionProcessor would have already created this path
+                  // as part of the create collection API call -- which is the only way in which a collection
+                  // with stateFormat > 1 can possibly be created
+                  continue;
+                }
                 zkClient.create(e.getKey(), data, CreateMode.PERSISTENT, true);
               }
             }