lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r1457864 - in /lucene/dev/trunk/solr: CHANGES.txt core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java
Date Mon, 18 Mar 2013 17:03:43 GMT
Author: markrmiller
Date: Mon Mar 18 17:03:42 2013
New Revision: 1457864

URL: http://svn.apache.org/r1457864
Log:
SOLR-4609: The Collections API should only send the reload command to ACTIVE cores. 

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1457864&r1=1457863&r2=1457864&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Mon Mar 18 17:03:42 2013
@@ -161,6 +161,9 @@ Bug Fixes
 
 * SOLR-4605: Rollback does not work correctly. (Mark S, Mark Miller)
 
+* SOLR-4609: The Collections API should only send the reload command to ACTIVE 
+  cores. (Mark Miller)
+
 Optimizations
 ----------------------
 

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java?rev=1457864&r1=1457863&r2=1457864&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java
(original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java
Mon Mar 18 17:03:42 2013
@@ -162,11 +162,11 @@ public class OverseerCollectionProcessor
         ModifiableSolrParams params = new ModifiableSolrParams();
         params.set(CoreAdminParams.ACTION, CoreAdminAction.UNLOAD.toString());
         params.set(CoreAdminParams.DELETE_INSTANCE_DIR, true);
-        collectionCmd(zkStateReader.getClusterState(), message, params, results);
+        collectionCmd(zkStateReader.getClusterState(), message, params, results, null);
       } else if (RELOADCOLLECTION.equals(operation)) {
         ModifiableSolrParams params = new ModifiableSolrParams();
         params.set(CoreAdminParams.ACTION, CoreAdminAction.RELOAD.toString());
-        collectionCmd(zkStateReader.getClusterState(), message, params, results);
+        collectionCmd(zkStateReader.getClusterState(), message, params, results, ZkStateReader.ACTIVE);
       } else if (CREATEALIAS.equals(operation)) {
         createAlias(zkStateReader.getAliases(), message);
       } else if (DELETEALIAS.equals(operation)) {
@@ -432,7 +432,7 @@ public class OverseerCollectionProcessor
     }
   }
   
-  private void collectionCmd(ClusterState clusterState, ZkNodeProps message, ModifiableSolrParams
params, NamedList results) {
+  private void collectionCmd(ClusterState clusterState, ZkNodeProps message, ModifiableSolrParams
params, NamedList results, String stateMatcher) {
     log.info("Executing Collection Cmd : " + params);
     String collectionName = message.getStr("name");
     
@@ -449,7 +449,7 @@ public class OverseerCollectionProcessor
       Set<Map.Entry<String,Replica>> shardEntries = shards.entrySet();
       for (Map.Entry<String,Replica> shardEntry : shardEntries) {
         final ZkNodeProps node = shardEntry.getValue();
-        if (clusterState.liveNodesContain(node.getStr(ZkStateReader.NODE_NAME_PROP))) {
+        if (clusterState.liveNodesContain(node.getStr(ZkStateReader.NODE_NAME_PROP)) &&
(stateMatcher != null ? node.getStr(ZkStateReader.STATE_PROP).equals(stateMatcher) : true))
{
           // For thread safety, only simple clone the ModifiableSolrParams
           ModifiableSolrParams cloneParams = new ModifiableSolrParams();
           cloneParams.add(params);



Mime
View raw message