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 2013/05/10 21:05:47 UTC

svn commit: r1481147 - in /lucene/dev/branches/lucene_solr_4_3: ./ solr/ solr/CHANGES.txt solr/core/ solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java

Author: shalin
Date: Fri May 10 19:05:45 2013
New Revision: 1481147

URL: http://svn.apache.org/r1481147
Log:
SOLR-4806: Shard splitting does not abort if WaitForState times out

Modified:
    lucene/dev/branches/lucene_solr_4_3/   (props changed)
    lucene/dev/branches/lucene_solr_4_3/solr/   (props changed)
    lucene/dev/branches/lucene_solr_4_3/solr/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/lucene_solr_4_3/solr/core/   (props changed)
    lucene/dev/branches/lucene_solr_4_3/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java

Modified: lucene/dev/branches/lucene_solr_4_3/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_3/solr/CHANGES.txt?rev=1481147&r1=1481146&r2=1481147&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_3/solr/CHANGES.txt (original)
+++ lucene/dev/branches/lucene_solr_4_3/solr/CHANGES.txt Fri May 10 19:05:45 2013
@@ -48,10 +48,11 @@ Bug Fixes
 * SOLR-4797: Shard splitting creates sub shards which have the wrong hash
   range in cluster state. This happens when numShards is not a power of two
   and router is compositeId. (shalin)
-  
-* SOLR-4791: solr.xml sharedLib does not work in 4.3.0 (Ryan Ernst, Jan Høydahl via 
+
+* SOLR-4791: solr.xml sharedLib does not work in 4.3.0 (Ryan Ernst, Jan Høydahl via
   Erick Erickson)
 
+* SOLR-4806: Shard splitting does not abort if WaitForState times out (shalin)
 
 Other Changes
 ----------------------
@@ -229,6 +230,9 @@ Bug Fixes
   for the top level group commands, causing output formatting differences
   compared to non-distributed grouping. (yonik)
 
+* SOLR-4705: Fixed bug causing NPE when querying a single replica in SolrCloud 
+  using the shards param (Raintung Li, hossman)
+
 * SOLR-4729: LukeRequestHandler: Using a dynamic copyField source that is
   not also a dynamic field triggers error message 'undefined field: "(glob)"'.
   (Adam Hahn, hossman, Steve Rowe)
@@ -253,9 +257,6 @@ Other Changes
   (Ryan Ernst via Robert Muir)
 
 * SOLR-4607: Use noggit 0.5 release jar rather than a forked copy.  (Yonik Seeley, Robert Muir)
-
-* SOLR-4624: forceNew has been removed from the DirectoryFactory and related java apis.
-  (Mark Miller)
   
 * SOLR-3706: Ship setup to log with log4j. (ryan, Mark Miller)
 

Modified: lucene/dev/branches/lucene_solr_4_3/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_3/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java?rev=1481147&r1=1481146&r2=1481147&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_3/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java (original)
+++ lucene/dev/branches/lucene_solr_4_3/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java Fri May 10 19:05:45 2013
@@ -371,13 +371,10 @@ public class OverseerCollectionProcessor
         }
       }
 
-      ShardResponse srsp;
-      do {
-        srsp = shardHandler.takeCompletedOrError();
-        if (srsp != null) {
-          processResponse(results, srsp);
-        }
-      } while (srsp != null);
+      // do not abort splitshard if the unloading fails
+      // this can happen because the replicas created previously may be down
+      // the only side effect of this is that the sub shard may end up having more replicas than we want
+      collectShardResponses(results, false, null);
 
       for (int i=0; i<subRanges.size(); i++)  {
         String subSlice = subSlices.get(i);
@@ -412,12 +409,8 @@ public class OverseerCollectionProcessor
         sendShardRequest(nodeName, new ModifiableSolrParams(cmd.getParams()));
       }
 
-      do {
-        srsp = shardHandler.takeCompletedOrError();
-        if (srsp != null) {
-          processResponse(results, srsp);
-        }
-      } while (srsp != null);
+      collectShardResponses(results, true,
+          "SPLTSHARD failed to create subshard leaders or timed out waiting for them to come up");
       
       log.info("Successfully created all sub-shards for collection "
           + collectionName + " parent shard: " + slice + " on: " + parentShardLeader);
@@ -435,12 +428,7 @@ public class OverseerCollectionProcessor
       }
 
       sendShardRequest(parentShardLeader.getNodeName(), params);
-      do {
-        srsp = shardHandler.takeCompletedOrError();
-        if (srsp != null) {
-          processResponse(results, srsp);
-        }
-      } while (srsp != null);
+      collectShardResponses(results, true, "SPLITSHARD failed to invoke SPLIT core admin command");
 
       log.info("Index on shard: " + nodeName + " split into two successfully");
 
@@ -457,12 +445,8 @@ public class OverseerCollectionProcessor
         sendShardRequest(nodeName, params);
       }
 
-      do {
-        srsp = shardHandler.takeCompletedOrError();
-        if (srsp != null) {
-          processResponse(results, srsp);
-        }
-      } while (srsp != null);
+      collectShardResponses(results, true,
+          "SPLITSHARD failed while asking sub shard leaders to apply buffered updates");
 
       log.info("Successfully applied buffered updates on : " + subShardNames);
 
@@ -534,12 +518,9 @@ public class OverseerCollectionProcessor
         }
       }
 
-      do {
-        srsp = shardHandler.takeCompletedOrError();
-        if (srsp != null) {
-          processResponse(results, srsp);
-        }
-      } while (srsp != null);
+      collectShardResponses(results, true,
+          "SPLTSHARD failed to create subshard replicas or timed out waiting for them to come up");
+
       log.info("Successfully created all replica shards for all sub-slices "
           + subSlices);
 
@@ -564,6 +545,19 @@ public class OverseerCollectionProcessor
     }
   }
 
+  private void collectShardResponses(NamedList results, boolean abortOnError, String msgOnError) {
+    ShardResponse srsp;
+    do {
+      srsp = shardHandler.takeCompletedOrError();
+      if (srsp != null) {
+        processResponse(results, srsp);
+        if (abortOnError && srsp.getException() != null)  {
+          throw new SolrException(ErrorCode.SERVER_ERROR, msgOnError, srsp.getException());
+        }
+      }
+    } while (srsp != null);
+  }
+
   private void sendShardRequest(String nodeName, ModifiableSolrParams params) {
     ShardRequest sreq = new ShardRequest();
     params.set("qt", adminPath);