mirror of https://github.com/apache/lucene.git
SOLR-7104: Propagate property prefix params for ADDREPLICA
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1660551 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8a254abccd
commit
d17e0ec7f4
|
@ -139,6 +139,9 @@ Bug Fixes
|
||||||
operate on stale cluster state due to overseer holding the state update lock for a
|
operate on stale cluster state due to overseer holding the state update lock for a
|
||||||
long time. (Mark Miller, shalin)
|
long time. (Mark Miller, shalin)
|
||||||
|
|
||||||
|
* SOLR-7104: Propagate property prefix parameters for ADDREPLICA Collections API call.
|
||||||
|
(Varun Thacker via Anshum Gupta)
|
||||||
|
|
||||||
Optimizations
|
Optimizations
|
||||||
----------------------
|
----------------------
|
||||||
* SOLR-7049: Move work done by the LIST Collections API call to the Collections
|
* SOLR-7049: Move work done by the LIST Collections API call to the Collections
|
||||||
|
|
|
@ -1023,6 +1023,7 @@ public class CollectionsHandler extends RequestHandlerBase {
|
||||||
props.put(Overseer.QUEUE_OPERATION, CollectionAction.ADDREPLICA.toString());
|
props.put(Overseer.QUEUE_OPERATION, CollectionAction.ADDREPLICA.toString());
|
||||||
copyIfNotNull(req.getParams(), props, COLLECTION_PROP, "node", SHARD_ID_PROP, ShardParams._ROUTE_,
|
copyIfNotNull(req.getParams(), props, COLLECTION_PROP, "node", SHARD_ID_PROP, ShardParams._ROUTE_,
|
||||||
CoreAdminParams.NAME, CoreAdminParams.INSTANCE_DIR, CoreAdminParams.DATA_DIR, ASYNC);
|
CoreAdminParams.NAME, CoreAdminParams.INSTANCE_DIR, CoreAdminParams.DATA_DIR, ASYNC);
|
||||||
|
copyPropertiesIfNotNull(req.getParams(), props);
|
||||||
ZkNodeProps m = new ZkNodeProps(props);
|
ZkNodeProps m = new ZkNodeProps(props);
|
||||||
handleResponse(CollectionAction.ADDREPLICA.toString(), m, rsp);
|
handleResponse(CollectionAction.ADDREPLICA.toString(), m, rsp);
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,7 @@ import org.apache.solr.common.cloud.ZkCoreNodeProps;
|
||||||
import org.apache.solr.common.cloud.ZkNodeProps;
|
import org.apache.solr.common.cloud.ZkNodeProps;
|
||||||
import org.apache.solr.common.cloud.ZkStateReader;
|
import org.apache.solr.common.cloud.ZkStateReader;
|
||||||
import org.apache.solr.common.params.CollectionParams.CollectionAction;
|
import org.apache.solr.common.params.CollectionParams.CollectionAction;
|
||||||
|
import org.apache.solr.common.params.CoreAdminParams;
|
||||||
import org.apache.solr.common.params.MapSolrParams;
|
import org.apache.solr.common.params.MapSolrParams;
|
||||||
import org.apache.solr.common.params.ModifiableSolrParams;
|
import org.apache.solr.common.params.ModifiableSolrParams;
|
||||||
import org.apache.solr.common.util.NamedList;
|
import org.apache.solr.common.util.NamedList;
|
||||||
|
@ -80,6 +81,7 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.Properties;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.CompletionService;
|
import java.util.concurrent.CompletionService;
|
||||||
import java.util.concurrent.ExecutorCompletionService;
|
import java.util.concurrent.ExecutorCompletionService;
|
||||||
|
@ -197,6 +199,7 @@ public class CollectionsAPIDistributedZkTest extends AbstractFullDistribZkTestBa
|
||||||
clusterPropTest();
|
clusterPropTest();
|
||||||
// last
|
// last
|
||||||
deleteCollectionWithDownNodes();
|
deleteCollectionWithDownNodes();
|
||||||
|
addReplicaTest();
|
||||||
|
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
super.printLayout();
|
super.printLayout();
|
||||||
|
@ -1115,6 +1118,10 @@ public class CollectionsAPIDistributedZkTest extends AbstractFullDistribZkTestBa
|
||||||
addReplica = new CollectionAdminRequest.AddReplica();
|
addReplica = new CollectionAdminRequest.AddReplica();
|
||||||
addReplica.setCollectionName(collectionName);
|
addReplica.setCollectionName(collectionName);
|
||||||
addReplica.setShardName("shard2");
|
addReplica.setShardName("shard2");
|
||||||
|
Properties props = new Properties();
|
||||||
|
String instancePathStr = createTempDir().toString();
|
||||||
|
props.put(CoreAdminParams.INSTANCE_DIR, instancePathStr); //Use name via the property.instanceDir method
|
||||||
|
addReplica.setProperties(props);
|
||||||
client.request(addReplica);
|
client.request(addReplica);
|
||||||
|
|
||||||
timeout = System.currentTimeMillis() + 3000;
|
timeout = System.currentTimeMillis() + 3000;
|
||||||
|
@ -1127,6 +1134,11 @@ public class CollectionsAPIDistributedZkTest extends AbstractFullDistribZkTestBa
|
||||||
|
|
||||||
assertNotNull(newReplica);
|
assertNotNull(newReplica);
|
||||||
|
|
||||||
|
HttpSolrClient coreclient = new HttpSolrClient(newReplica.getStr(ZkStateReader.BASE_URL_PROP));
|
||||||
|
CoreAdminResponse status = CoreAdminRequest.getStatus(newReplica.getStr("core"), coreclient);
|
||||||
|
NamedList<Object> coreStatus = status.getCoreStatus(newReplica.getStr("core"));
|
||||||
|
String instanceDirStr = (String) coreStatus.get("instanceDir");
|
||||||
|
assertEquals(Paths.get(instanceDirStr).toString(), instancePathStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue