Apache Solr open-source search software
SOLR-4055: clone params for create calls
Mark Robert Miller446080b6b5d3
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 2a8bf877379..8e8c3fa2cd0 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -206,7 +206,7 @@ Bug Fixes* SOLR-4055: Fix a thread safety issue with the Collections API that couldcause actions to be targeted at the wrong SolrCores.- (Raintung Li via Mark Miller)+ (Raintung Li, Per Steffensen via Mark Miller)* SOLR-3993: If multiple SolrCore's for a shard coexist on a node, on clusterrestart, leader election would stall until timeout, waiting to see all ofdiff --git a/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java b/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.javaindex e881f58e2c8..377265929b8 100644--- a/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java+++ b/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java@@ -201,11 +201,7 @@ public class OverseerCollectionProcessor implements Runnable {// we need to look at every node and see how many cores it serves// add our new cores to existing nodes serving the least number of cores// but (for now) require that each core goes on a distinct node.-- ModifiableSolrParams params = new ModifiableSolrParams();- params.set(CoreAdminParams.ACTION, CoreAdminAction.CREATE.toString());--+// TODO: add smarter options that look at the current number of cores per node?// for now we just go randomSet<String> nodes = clusterState.getLiveNodes();@@ -230,6 +226,11 @@ public class OverseerCollectionProcessor implements Runnable {for (String replica : createOnNodes) {// TODO: this does not work if original url had _ in it// We should have a master list++ // Need to create new params for each request+ ModifiableSolrParams params = new ModifiableSolrParams();+ params.set(CoreAdminParams.ACTION, CoreAdminAction.CREATE.toString());+replica = replica.replaceAll("_", "/");params.set(CoreAdminParams.NAME, name);params.set("collection.configName", configName);