lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r1546278 - in /lucene/dev/trunk/solr/core/src/java/org/apache/solr: servlet/SolrDispatchFilter.java update/SolrCmdDistributor.java update/processor/DistributedUpdateProcessor.java
Date Thu, 28 Nov 2013 04:09:02 GMT
Author: markrmiller
Date: Thu Nov 28 04:09:02 2013
New Revision: 1546278

URL: http://svn.apache.org/r1546278
Log:
SOLR-5509: Always add a param for 'from' node.

Modified:
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java?rev=1546278&r1=1546277&r2=1546278&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java Thu
Nov 28 04:09:02 2013
@@ -52,7 +52,6 @@ import org.apache.solr.response.QueryRes
 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 implemen
             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;

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java?rev=1546278&r1=1546277&r2=1546278&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java Thu
Nov 28 04:09:02 2013
@@ -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));

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java?rev=1546278&r1=1546277&r2=1546278&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
(original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
Thu Nov 28 04:09:02 2013
@@ -576,13 +576,8 @@ public class DistributedUpdateProcessor 
                  (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 
 
       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 
 
       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 
       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();



Mime
View raw message