You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by an...@apache.org on 2014/08/13 10:17:51 UTC
svn commit: r1617678 - in /lucene/dev/branches/branch_4x/solr: ./
CHANGES.txt core/
core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java
core/src/test/org/apache/solr/cloud/DeleteLastCustomShardedReplicaTest.java
Author: anshum
Date: Wed Aug 13 08:17:50 2014
New Revision: 1617678
URL: http://svn.apache.org/r1617678
Log:
SOLR-6347: Fix NPE during last replica deletion for custom sharded collections using DELETEREPLICA (Merge from trunk r1617673)
Added:
lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/cloud/DeleteLastCustomShardedReplicaTest.java
- copied unchanged from r1617673, lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/DeleteLastCustomShardedReplicaTest.java
Modified:
lucene/dev/branches/branch_4x/solr/ (props changed)
lucene/dev/branches/branch_4x/solr/CHANGES.txt (contents, props changed)
lucene/dev/branches/branch_4x/solr/core/ (props changed)
lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java
Modified: lucene/dev/branches/branch_4x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/CHANGES.txt?rev=1617678&r1=1617677&r2=1617678&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_4x/solr/CHANGES.txt Wed Aug 13 08:17:50 2014
@@ -180,6 +180,8 @@ Bug Fixes
* SOLR-6336: DistributedQueue can easily create too many ZooKeeper Watches.
(Ramkumar Aiyengar via Mark Miller)
+* SOLR-6347: DELETEREPLICA throws a NPE while removing the last Replica in a Custom sharded collection.
+
Optimizations
---------------------
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java?rev=1617678&r1=1617677&r2=1617678&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java Wed Aug 13 08:17:50 2014
@@ -908,8 +908,15 @@ public class OverseerCollectionProcessor
boolean deleted = false;
while (System.nanoTime() < waitUntil) {
Thread.sleep(100);
- deleted = zkStateReader.getClusterState().getCollection(collectionName).getSlice(shard).getReplica(replicaName) == null;
- if (deleted) break;
+ DocCollection docCollection = zkStateReader.getClusterState().getCollection(collectionName);
+ if(docCollection != null) {
+ Slice slice = docCollection.getSlice(shard);
+ if(slice == null || slice.getReplica(replicaName) == null) {
+ deleted = true;
+ }
+ }
+ // Return true if either someone already deleted the collection/slice/replica.
+ if (docCollection == null || deleted) break;
}
return deleted;
}