From a59dec83e51fe4013375f22980fcf9d7e3272432 Mon Sep 17 00:00:00 2001 From: Mark Robert Miller Date: Mon, 30 Dec 2013 04:28:35 +0000 Subject: [PATCH] SOLR-5580: Remove more code that is not legal for determining if a core is new or not. git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1554138 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/solr/cloud/ZkController.java | 16 +--------------- .../solr/cloud/DeleteInactiveReplicaTest.java | 2 ++ 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkController.java b/solr/core/src/java/org/apache/solr/cloud/ZkController.java index dde05af6732..7da73667b3d 100644 --- a/solr/core/src/java/org/apache/solr/cloud/ZkController.java +++ b/solr/core/src/java/org/apache/solr/cloud/ZkController.java @@ -1334,21 +1334,7 @@ public final class ZkController { // this also gets us our assigned shard id if it was not specified try { CloudDescriptor cloudDesc = cd.getCloudDescriptor(); - if(cd.getCloudDescriptor().getCollectionName() !=null && cloudDesc.getCoreNodeName() != null ) { - //we were already registered - if(zkStateReader.getClusterState().hasCollection(cloudDesc.getCollectionName())){ - DocCollection coll = zkStateReader.getClusterState().getCollection(cloudDesc.getCollectionName()); - if(!"true".equals(coll.getStr("autoCreated"))){ - Slice slice = coll.getSlice(cloudDesc.getShardId()); - if(slice != null){ - if(slice.getReplica(cloudDesc.getCoreNodeName()) == null) { - log.info("core_removed This core is removed from ZK"); - throw new SolrException(ErrorCode.NOT_FOUND,cloudDesc.getCoreNodeName() +" is removed"); - } - } - } - } - } + // make sure the node name is set on the descriptor if (cloudDesc.getCoreNodeName() == null) { diff --git a/solr/core/src/test/org/apache/solr/cloud/DeleteInactiveReplicaTest.java b/solr/core/src/test/org/apache/solr/cloud/DeleteInactiveReplicaTest.java index 8a2c10db867..0382e27ce55 100644 --- a/solr/core/src/test/org/apache/solr/cloud/DeleteInactiveReplicaTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/DeleteInactiveReplicaTest.java @@ -34,7 +34,9 @@ import org.apache.solr.common.params.MapSolrParams; import org.apache.solr.common.util.NamedList; import org.junit.After; import org.junit.Before; +import org.junit.Ignore; +@Ignore("Not currently valid see SOLR-5580") public class DeleteInactiveReplicaTest extends DeleteReplicaTest{ private CloudSolrServer client;