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.response.SolrQueryResponse;
|
||||||
import org.apache.solr.servlet.cache.HttpCacheHeaderUtil;
|
import org.apache.solr.servlet.cache.HttpCacheHeaderUtil;
|
||||||
import org.apache.solr.servlet.cache.Method;
|
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.update.processor.DistributingUpdateProcessorFactory;
|
||||||
import org.apache.solr.util.FastWriter;
|
import org.apache.solr.util.FastWriter;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
@ -319,8 +318,7 @@ public class SolrDispatchFilter implements Filter
|
||||||
SolrParams queryParams = SolrRequestParsers.parseQueryString(req.getQueryString());
|
SolrParams queryParams = SolrRequestParsers.parseQueryString(req.getQueryString());
|
||||||
if (coreUrl != null
|
if (coreUrl != null
|
||||||
&& queryParams
|
&& queryParams
|
||||||
.get(DistributingUpdateProcessorFactory.DISTRIB_UPDATE_PARAM) == null
|
.get(DistributingUpdateProcessorFactory.DISTRIB_UPDATE_PARAM) == null) {
|
||||||
&& queryParams.get(DistributedUpdateProcessor.DISTRIB_FROM) == null) {
|
|
||||||
path = path.substring(idx);
|
path = path.substring(idx);
|
||||||
remoteQuery(coreUrl + path, req, solrReq, resp);
|
remoteQuery(coreUrl + path, req, solrReq, resp);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -197,7 +197,7 @@ public class SolrCmdDistributor {
|
||||||
|
|
||||||
addCommit(uReq, cmd);
|
addCommit(uReq, cmd);
|
||||||
|
|
||||||
log.debug("Distrib commit to:" + nodes + " params:" + params);
|
log.debug("Distrib commit to: {} params: {}", nodes, params);
|
||||||
|
|
||||||
for (Node node : nodes) {
|
for (Node node : nodes) {
|
||||||
submit(new Req(cmd.toString(), node, uReq, false));
|
submit(new Req(cmd.toString(), node, uReq, false));
|
||||||
|
|
|
@ -576,13 +576,8 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
|
||||||
(isLeader || isSubShardLeader ?
|
(isLeader || isSubShardLeader ?
|
||||||
DistribPhase.FROMLEADER.toString() :
|
DistribPhase.FROMLEADER.toString() :
|
||||||
DistribPhase.TOLEADER.toString()));
|
DistribPhase.TOLEADER.toString()));
|
||||||
if (isLeader || isSubShardLeader) {
|
|
||||||
params.set(DISTRIB_FROM, ZkCoreNodeProps.getCoreUrl(
|
params.set(DISTRIB_FROM, ZkCoreNodeProps.getCoreUrl(
|
||||||
zkController.getBaseUrl(), req.getCore().getName()));
|
zkController.getBaseUrl(), req.getCore().getName()));
|
||||||
} else if (log.isDebugEnabled()) {
|
|
||||||
params.set(DISTRIB_FROM, ZkCoreNodeProps.getCoreUrl(
|
|
||||||
zkController.getBaseUrl(), req.getCore().getName()));
|
|
||||||
}
|
|
||||||
|
|
||||||
cmdDistrib.distribAdd(cmd, nodes, params);
|
cmdDistrib.distribAdd(cmd, nodes, params);
|
||||||
}
|
}
|
||||||
|
@ -1005,16 +1000,11 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
|
||||||
|
|
||||||
params = new ModifiableSolrParams(filterParams(req.getParams()));
|
params = new ModifiableSolrParams(filterParams(req.getParams()));
|
||||||
params.set(DISTRIB_UPDATE_PARAM,
|
params.set(DISTRIB_UPDATE_PARAM,
|
||||||
(isLeader || isSubShardLeader ?
|
(isLeader || isSubShardLeader ? DistribPhase.FROMLEADER.toString()
|
||||||
DistribPhase.FROMLEADER.toString() :
|
: DistribPhase.TOLEADER.toString()));
|
||||||
DistribPhase.TOLEADER.toString()));
|
|
||||||
if (isLeader || isSubShardLeader) {
|
|
||||||
params.set(DISTRIB_FROM, ZkCoreNodeProps.getCoreUrl(
|
params.set(DISTRIB_FROM, ZkCoreNodeProps.getCoreUrl(
|
||||||
zkController.getBaseUrl(), req.getCore().getName()));
|
zkController.getBaseUrl(), req.getCore().getName()));
|
||||||
} else if (log.isDebugEnabled()) {
|
|
||||||
params.set(DISTRIB_FROM, ZkCoreNodeProps.getCoreUrl(
|
|
||||||
zkController.getBaseUrl(), req.getCore().getName()));
|
|
||||||
}
|
|
||||||
cmdDistrib.distribDelete(cmd, nodes, params);
|
cmdDistrib.distribDelete(cmd, nodes, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1075,10 +1065,8 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
|
||||||
|
|
||||||
ModifiableSolrParams outParams = new ModifiableSolrParams(filterParams(req.getParams()));
|
ModifiableSolrParams outParams = new ModifiableSolrParams(filterParams(req.getParams()));
|
||||||
outParams.set(DISTRIB_UPDATE_PARAM, DistribPhase.TOLEADER.toString());
|
outParams.set(DISTRIB_UPDATE_PARAM, DistribPhase.TOLEADER.toString());
|
||||||
if (log.isDebugEnabled()) {
|
|
||||||
outParams.set(DISTRIB_FROM, ZkCoreNodeProps.getCoreUrl(
|
outParams.set(DISTRIB_FROM, ZkCoreNodeProps.getCoreUrl(
|
||||||
zkController.getBaseUrl(), req.getCore().getName()));
|
zkController.getBaseUrl(), req.getCore().getName()));
|
||||||
}
|
|
||||||
|
|
||||||
SolrParams params = req.getParams();
|
SolrParams params = req.getParams();
|
||||||
String route = params.get(ShardParams._ROUTE_);
|
String route = params.get(ShardParams._ROUTE_);
|
||||||
|
@ -1434,7 +1422,9 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
|
||||||
ModifiableSolrParams params = new ModifiableSolrParams(filterParams(req.getParams()));
|
ModifiableSolrParams params = new ModifiableSolrParams(filterParams(req.getParams()));
|
||||||
if (!req.getParams().getBool(COMMIT_END_POINT, false)) {
|
if (!req.getParams().getBool(COMMIT_END_POINT, false)) {
|
||||||
params.set(COMMIT_END_POINT, true);
|
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) {
|
if (nodes != null) {
|
||||||
cmdDistrib.distribCommit(cmd, nodes, params);
|
cmdDistrib.distribCommit(cmd, nodes, params);
|
||||||
finish();
|
finish();
|
||||||
|
|
Loading…
Reference in New Issue