mirror of https://github.com/apache/lucene.git
SOLR-5509: Always add a param for 'from' node.
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1546278 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
efbc66ca8f
commit
301d7a080a
|
@ -52,7 +52,6 @@ import org.apache.solr.response.QueryResponseWriter;
|
|||
import org.apache.solr.response.SolrQueryResponse;
|
||||
import org.apache.solr.servlet.cache.HttpCacheHeaderUtil;
|
||||
import org.apache.solr.servlet.cache.Method;
|
||||
import org.apache.solr.update.processor.DistributedUpdateProcessor;
|
||||
import org.apache.solr.update.processor.DistributingUpdateProcessorFactory;
|
||||
import org.apache.solr.util.FastWriter;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -319,8 +318,7 @@ public class SolrDispatchFilter implements Filter
|
|||
SolrParams queryParams = SolrRequestParsers.parseQueryString(req.getQueryString());
|
||||
if (coreUrl != null
|
||||
&& queryParams
|
||||
.get(DistributingUpdateProcessorFactory.DISTRIB_UPDATE_PARAM) == null
|
||||
&& queryParams.get(DistributedUpdateProcessor.DISTRIB_FROM) == null) {
|
||||
.get(DistributingUpdateProcessorFactory.DISTRIB_UPDATE_PARAM) == null) {
|
||||
path = path.substring(idx);
|
||||
remoteQuery(coreUrl + path, req, solrReq, resp);
|
||||
return;
|
||||
|
|
|
@ -197,7 +197,7 @@ public class SolrCmdDistributor {
|
|||
|
||||
addCommit(uReq, cmd);
|
||||
|
||||
log.debug("Distrib commit to:" + nodes + " params:" + params);
|
||||
log.debug("Distrib commit to: {} params: {}", nodes, params);
|
||||
|
||||
for (Node node : nodes) {
|
||||
submit(new Req(cmd.toString(), node, uReq, false));
|
||||
|
|
|
@ -576,13 +576,8 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
|
|||
(isLeader || isSubShardLeader ?
|
||||
DistribPhase.FROMLEADER.toString() :
|
||||
DistribPhase.TOLEADER.toString()));
|
||||
if (isLeader || isSubShardLeader) {
|
||||
params.set(DISTRIB_FROM, ZkCoreNodeProps.getCoreUrl(
|
||||
zkController.getBaseUrl(), req.getCore().getName()));
|
||||
} else if (log.isDebugEnabled()) {
|
||||
params.set(DISTRIB_FROM, ZkCoreNodeProps.getCoreUrl(
|
||||
zkController.getBaseUrl(), req.getCore().getName()));
|
||||
}
|
||||
params.set(DISTRIB_FROM, ZkCoreNodeProps.getCoreUrl(
|
||||
zkController.getBaseUrl(), req.getCore().getName()));
|
||||
|
||||
cmdDistrib.distribAdd(cmd, nodes, params);
|
||||
}
|
||||
|
@ -1005,16 +1000,11 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
|
|||
|
||||
params = new ModifiableSolrParams(filterParams(req.getParams()));
|
||||
params.set(DISTRIB_UPDATE_PARAM,
|
||||
(isLeader || isSubShardLeader ?
|
||||
DistribPhase.FROMLEADER.toString() :
|
||||
DistribPhase.TOLEADER.toString()));
|
||||
if (isLeader || isSubShardLeader) {
|
||||
params.set(DISTRIB_FROM, ZkCoreNodeProps.getCoreUrl(
|
||||
zkController.getBaseUrl(), req.getCore().getName()));
|
||||
} else if (log.isDebugEnabled()) {
|
||||
params.set(DISTRIB_FROM, ZkCoreNodeProps.getCoreUrl(
|
||||
zkController.getBaseUrl(), req.getCore().getName()));
|
||||
}
|
||||
(isLeader || isSubShardLeader ? DistribPhase.FROMLEADER.toString()
|
||||
: DistribPhase.TOLEADER.toString()));
|
||||
params.set(DISTRIB_FROM, ZkCoreNodeProps.getCoreUrl(
|
||||
zkController.getBaseUrl(), req.getCore().getName()));
|
||||
|
||||
cmdDistrib.distribDelete(cmd, nodes, params);
|
||||
}
|
||||
|
||||
|
@ -1075,10 +1065,8 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
|
|||
|
||||
ModifiableSolrParams outParams = new ModifiableSolrParams(filterParams(req.getParams()));
|
||||
outParams.set(DISTRIB_UPDATE_PARAM, DistribPhase.TOLEADER.toString());
|
||||
if (log.isDebugEnabled()) {
|
||||
outParams.set(DISTRIB_FROM, ZkCoreNodeProps.getCoreUrl(
|
||||
zkController.getBaseUrl(), req.getCore().getName()));
|
||||
}
|
||||
outParams.set(DISTRIB_FROM, ZkCoreNodeProps.getCoreUrl(
|
||||
zkController.getBaseUrl(), req.getCore().getName()));
|
||||
|
||||
SolrParams params = req.getParams();
|
||||
String route = params.get(ShardParams._ROUTE_);
|
||||
|
@ -1434,7 +1422,9 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
|
|||
ModifiableSolrParams params = new ModifiableSolrParams(filterParams(req.getParams()));
|
||||
if (!req.getParams().getBool(COMMIT_END_POINT, false)) {
|
||||
params.set(COMMIT_END_POINT, true);
|
||||
|
||||
params.set(DISTRIB_UPDATE_PARAM, DistribPhase.FROMLEADER.toString());
|
||||
params.set(DISTRIB_FROM, ZkCoreNodeProps.getCoreUrl(
|
||||
zkController.getBaseUrl(), req.getCore().getName()));
|
||||
if (nodes != null) {
|
||||
cmdDistrib.distribCommit(cmd, nodes, params);
|
||||
finish();
|
||||
|
|
Loading…
Reference in New Issue