You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2011/12/14 19:12:44 UTC

svn commit: r1214390 - in /lucene/dev/branches/solrcloud/solr/core/src: java/org/apache/solr/update/processor/DistributedUpdateProcessor.java test/org/apache/solr/cloud/BasicZkTest.java

Author: markrmiller
Date: Wed Dec 14 18:12:43 2011
New Revision: 1214390

URL: http://svn.apache.org/viewvc?rev=1214390&view=rev
Log:
make the proper comparison so that we do not update to ourselves through http

Modified:
    lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
    lucene/dev/branches/solrcloud/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java?rev=1214390&r1=1214389&r2=1214390&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java Wed Dec 14 18:12:43 2011
@@ -610,7 +610,7 @@ public class DistributedUpdateProcessor 
   }
   
   private List<String> getReplicaUrls(SolrQueryRequest req, String collection,
-      String shardId, String shardZkNodeName) {
+      String shardId, String thisNodeName) {
     CloudState cloudState = req.getCore().getCoreDescriptor()
         .getCoreContainer().getZkController().getCloudState();
    
@@ -628,8 +628,8 @@ public class DistributedUpdateProcessor 
     List<String> urls = new ArrayList<String>(shardMap.size());
 
     for (Entry<String,ZkNodeProps> entry : shardMap.entrySet()) {
-      if (cloudState.liveNodesContain(entry.getValue().get(
-          ZkStateReader.NODE_NAME_PROP)) && !entry.getKey().equals(shardZkNodeName)) {
+      String nodeName = entry.getValue().get(ZkStateReader.NODE_NAME_PROP);
+      if (cloudState.liveNodesContain(nodeName) && !nodeName.equals(thisNodeName)) {
         String replicaUrl = entry.getValue().get(ZkStateReader.URL_PROP);
         urls.add(replicaUrl);
       }

Modified: lucene/dev/branches/solrcloud/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java?rev=1214390&r1=1214389&r2=1214390&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java Wed Dec 14 18:12:43 2011
@@ -29,7 +29,10 @@ import org.junit.Test;
 import org.xml.sax.SAXParseException;
 
 /**
- *
+ * This test is not fully functional - the port registered is illegal - 
+ * so you cannot hit this with http - a nice side benifit is that it will
+ * detect if a node is trying to do an update to itself with http - it shouldn't
+ * do that.
  */
 public class BasicZkTest extends AbstractZkTestCase {