Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-4644: try passing test.distrib.skip.servers on - if we hit a replica, we want it passed to the leader

Mark Robert Miller2b6e3dd7ad06
diff --git a/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java b/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
index dd13f2cd050..b2d1ecdc1d5 100644
--- a/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
+++ b/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
@@ -77,6 +77,7 @@ import static org.apache.solr.update.processor.DistributingUpdateProcessorFactor
// NOT mt-safe... create a new processor for each add thread
// TODO: we really should not wait for distrib after local? unless a certain replication factor is asked for
public class DistributedUpdateProcessor extends UpdateRequestProcessor {
+ private static final String TEST_DISTRIB_SKIP_SERVERS = "test.distrib.skip.servers";
public final static Logger log = LoggerFactory.getLogger(DistributedUpdateProcessor.class);
/**
@@ -241,7 +242,7 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
if (replicaProps != null) {
nodes = new ArrayList<Node>(replicaProps.size());
// check for test param that lets us miss replicas
- String[] skipList = req.getParams().getParams("test.distrib.skip.servers");
+ String[] skipList = req.getParams().getParams(TEST_DISTRIB_SKIP_SERVERS);
Set<String> skipListSet = null;
if (skipList != null) {
skipListSet = new HashSet<String>(skipList.length);
@@ -756,6 +757,7 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
private ModifiableSolrParams filterParams(SolrParams params) {
ModifiableSolrParams fparams = new ModifiableSolrParams();
passParam(params, fparams, UpdateParams.UPDATE_CHAIN);
+ passParam(params, fparams, TEST_DISTRIB_SKIP_SERVERS);
return fparams;
}