lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r1390274 - in /lucene/dev/branches/branch_4x: ./ solr/ solr/CHANGES.txt solr/core/ solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
Date Wed, 26 Sep 2012 03:52:44 GMT
Author: markrmiller
Date: Wed Sep 26 03:52:44 2012
New Revision: 1390274

URL: http://svn.apache.org/viewvc?rev=1390274&view=rev
Log:
SOLR-3883: Distributed indexing forwards non-applicable request params.

Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/solr/   (props changed)
    lucene/dev/branches/branch_4x/solr/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/branch_4x/solr/core/   (props changed)
    lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java

Modified: lucene/dev/branches/branch_4x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/CHANGES.txt?rev=1390274&r1=1390273&r2=1390274&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_4x/solr/CHANGES.txt Wed Sep 26 03:52:44 2012
@@ -373,6 +373,9 @@ Bug Fixes
 * SOLR-3892: Inconsistent locking when accessing cache in CachingDirectoryFactory
   from RAMDirectoryFactory and MockDirectoryFactory. (phunt via Mark Miller)
 
+* SOLR-3883: Distributed indexing forwards non-applicable request params.
+  (Dan Sutton, Per Steffensen, yonik, Mark Miller)
+
 Other Changes
 ----------------------
 

Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java?rev=1390274&r1=1390273&r2=1390274&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
(original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
Wed Sep 26 03:52:44 2012
@@ -45,6 +45,7 @@ import org.apache.solr.common.cloud.ZkSt
 import org.apache.solr.common.cloud.ZooKeeperException;
 import org.apache.solr.common.params.CoreAdminParams.CoreAdminAction;
 import org.apache.solr.common.params.ModifiableSolrParams;
+import org.apache.solr.common.params.SolrParams;
 import org.apache.solr.common.params.UpdateParams;
 import org.apache.solr.common.util.Hash;
 import org.apache.solr.common.util.NamedList;
@@ -332,7 +333,7 @@ public class DistributedUpdateProcessor 
     ModifiableSolrParams params = null;
     if (nodes != null) {
       
-      params = new ModifiableSolrParams(req.getParams());
+      params = new ModifiableSolrParams(filterParams(req.getParams()));
       params.set(DISTRIB_UPDATE_PARAM, 
                  (isLeader ? 
                   DistribPhase.FROMLEADER.toString() : 
@@ -341,7 +342,7 @@ public class DistributedUpdateProcessor 
         params.set("distrib.from", ZkCoreNodeProps.getCoreUrl(
             zkController.getBaseUrl(), req.getCore().getName()));
       }
-      params.remove("commit"); // this will be distributed from the local commit
+
       params.set("distrib.from", ZkCoreNodeProps.getCoreUrl(
           zkController.getBaseUrl(), req.getCore().getName()));
       cmdDistrib.distribAdd(cmd, nodes, params);
@@ -679,7 +680,7 @@ public class DistributedUpdateProcessor 
     ModifiableSolrParams params = null;
     if (nodes != null) {
       
-      params = new ModifiableSolrParams(req.getParams());
+      params = new ModifiableSolrParams(filterParams(req.getParams()));
       params.set(DISTRIB_UPDATE_PARAM, 
                  (isLeader ? 
                   DistribPhase.FROMLEADER.toString() : 
@@ -688,7 +689,6 @@ public class DistributedUpdateProcessor 
         params.set("distrib.from", ZkCoreNodeProps.getCoreUrl(
             zkController.getBaseUrl(), req.getCore().getName()));
       }
-      params.remove("commit"); // we already will have forwarded this from our local commit
       cmdDistrib.distribDelete(cmd, nodes, params);
     }
 
@@ -705,6 +705,19 @@ public class DistributedUpdateProcessor 
     }
   }
 
+  private ModifiableSolrParams filterParams(SolrParams params) {
+    ModifiableSolrParams fparams = new ModifiableSolrParams();
+    passParam(params, fparams, UpdateParams.UPDATE_CHAIN);
+    return fparams;
+  }
+
+  private void passParam(SolrParams params, ModifiableSolrParams fparams, String param) {
+    String value = params.get(param);
+    if (value != null) {
+      fparams.add(param, value);
+    }
+  }
+
   public void doDeleteByQuery(DeleteUpdateCommand cmd) throws IOException {
     // even in non zk mode, tests simulate updates from a leader
     if(!zkEnabled) {
@@ -735,7 +748,7 @@ public class DistributedUpdateProcessor 
                 + zkController.getClusterState().getCollections());
       }
 
-      ModifiableSolrParams params = new ModifiableSolrParams(req.getParams());
+      ModifiableSolrParams params = new ModifiableSolrParams(filterParams(req.getParams()));
       params.set(DISTRIB_UPDATE_PARAM, DistribPhase.TOLEADER.toString());
 
       List<Node> leaders =  new ArrayList<Node>(slices.size());
@@ -846,7 +859,7 @@ public class DistributedUpdateProcessor 
 
     // forward to all replicas
     if (leaderLogic && replicas != null) {
-      ModifiableSolrParams params = new ModifiableSolrParams(req.getParams());
+      ModifiableSolrParams params = new ModifiableSolrParams(filterParams(req.getParams()));
       params.set(VERSION_FIELD, Long.toString(cmd.getVersion()));
       params.set(DISTRIB_UPDATE_PARAM, DistribPhase.FROMLEADER.toString());
       params.set("update.from", ZkCoreNodeProps.getCoreUrl(
@@ -1004,8 +1017,8 @@ public class DistributedUpdateProcessor 
     // TODO: we should consider this? commit everyone in the current collection
 
     if (zkEnabled) {
-      ModifiableSolrParams params = new ModifiableSolrParams(req.getParams());
-      if (!params.getBool(COMMIT_END_POINT, false)) {
+      ModifiableSolrParams params = new ModifiableSolrParams(filterParams(req.getParams()));
+      if (!req.getParams().getBool(COMMIT_END_POINT, false)) {
         params.set(COMMIT_END_POINT, true);
 
         String nodeName = req.getCore().getCoreDescriptor().getCoreContainer()



Mime
View raw message