SOLR-7015 collection create with stateFormat=2 fails if conf name equals collection name

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1653788 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Noble Paul 2015-01-22 09:12:59 +00:00
parent 24d9371125
commit 51016c0fdb
2 changed files with 12 additions and 0 deletions

View File

@ -2632,6 +2632,8 @@ public class OverseerCollectionProcessor implements Runnable, Closeable {
configName = configNames.get(0); configName = configNames.get(0);
// no config set named, but there is only 1 - use it // no config set named, but there is only 1 - use it
log.info("Only one config set found in zk - using it:" + configName); log.info("Only one config set found in zk - using it:" + configName);
} else if(configNames.contains(coll)) {
configName = coll;
} }
} catch (KeeperException.NoNodeException e) { } catch (KeeperException.NoNodeException e) {

View File

@ -24,6 +24,8 @@ import org.apache.solr.common.cloud.DocCollection;
import org.apache.solr.common.cloud.ZkStateReader; import org.apache.solr.common.cloud.ZkStateReader;
import org.apache.solr.common.params.CollectionParams; import org.apache.solr.common.params.CollectionParams;
import org.apache.solr.common.params.ModifiableSolrParams; import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.handler.BlobHandler;
import org.apache.solr.handler.TestBlobHandler;
import org.apache.zookeeper.data.Stat; import org.apache.zookeeper.data.Stat;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;
@ -69,6 +71,7 @@ public class ExternalCollectionsTest extends AbstractFullDistribZkTestBase {
@Override @Override
public void doTest() throws Exception { public void doTest() throws Exception {
testZkNodeLocation(); testZkNodeLocation();
testConfNameAndCollectionNameSame();
} }
@ -78,6 +81,13 @@ public class ExternalCollectionsTest extends AbstractFullDistribZkTestBase {
return 2; return 2;
} }
private void testConfNameAndCollectionNameSame() throws Exception{
// .system collection precreates the configset
createCollection(".system", client, 2, 1);
waitForRecoveriesToFinish(".system", false);
}
private void testZkNodeLocation() throws Exception{ private void testZkNodeLocation() throws Exception{
String collectionName = "myExternColl"; String collectionName = "myExternColl";