lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r1493885 - in /lucene/dev/branches/branch_4x: ./ solr/ solr/CHANGES.txt solr/solrj/ solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java
Date Mon, 17 Jun 2013 18:53:33 GMT
Author: markrmiller
Date: Mon Jun 17 18:53:32 2013
New Revision: 1493885

URL: http://svn.apache.org/r1493885
Log:
SOLR-4923: Commits to non leaders as part of a request that also contain updates can execute
out of order.
SOLR-4923: add optimization CHANGES entry
SOLR-4923: add missing credit

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/solrj/   (props changed)
    lucene/dev/branches/branch_4x/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java
    lucene/dev/branches/branch_4x/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.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=1493885&r1=1493884&r2=1493885&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_4x/solr/CHANGES.txt Mon Jun 17 18:53:32 2013
@@ -132,7 +132,13 @@ Bug Fixes
   (Erick Erickson)
 
 * SOLR-4923: Commits to non leaders as part of a request that also contain updates
-  can execute out of order. (hossman, Mark Miller)
+  can execute out of order. (hossman, Ricardo Merizalde, Mark Miller)
+
+Optimizations
+----------------------
+
+* SOLR-4923: Commit to all nodes in a collection in parallel rather than locally and
+  then to all other nodes. (hossman, Ricardo Merizalde, Mark Miller)
 
 Other Changes
 ----------------------

Modified: lucene/dev/branches/branch_4x/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java?rev=1493885&r1=1493884&r2=1493885&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java
(original)
+++ lucene/dev/branches/branch_4x/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java
Mon Jun 17 18:53:32 2013
@@ -355,6 +355,10 @@ public class CloudSolrServer extends Sol
   public LBHttpSolrServer getLbServer() {
     return lbServer;
   }
+  
+  public boolean isUpdatesToLeaders() {
+    return updatesToLeaders;
+  }
 
   // for tests
   Map<String,List<String>> getUrlLists() {

Modified: lucene/dev/branches/branch_4x/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java?rev=1493885&r1=1493884&r2=1493885&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java
(original)
+++ lucene/dev/branches/branch_4x/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java
Mon Jun 17 18:53:32 2013
@@ -102,35 +102,39 @@ public class CloudSolrServerTest extends
 
     indexr(id, 0, "a_t", "to come to the aid of their country.");
     
-    // compare leaders list
     CloudJettyRunner shard1Leader = shardToLeaderJetty.get("shard1");
     CloudJettyRunner shard2Leader = shardToLeaderJetty.get("shard2");
-    assertEquals(2, cloudClient.getLeaderUrlLists().get("collection1").size());
-    HashSet<String> leaderUrlSet = new HashSet<String>();
-    leaderUrlSet.addAll(cloudClient.getLeaderUrlLists().get("collection1"));
-    assertTrue("fail check for leader:" + shard1Leader.url + " in "
-        + leaderUrlSet, leaderUrlSet.contains(shard1Leader.url + "/"));
-    assertTrue("fail check for leader:" + shard2Leader.url + " in "
-        + leaderUrlSet, leaderUrlSet.contains(shard2Leader.url + "/"));
-
-    // compare replicas list
-    Set<String> replicas = new HashSet<String>();
-    List<CloudJettyRunner> jetties = shardToJetty.get("shard1");
-    for (CloudJettyRunner cjetty : jetties) {
-      replicas.add(cjetty.url);
-    }
-    jetties = shardToJetty.get("shard2");
-    for (CloudJettyRunner cjetty : jetties) {
-      replicas.add(cjetty.url);
-    }
-    replicas.remove(shard1Leader.url);
-    replicas.remove(shard2Leader.url);
-    
-    assertEquals(replicas.size(), cloudClient.getReplicasLists().get("collection1").size());
     
-    for (String url : cloudClient.getReplicasLists().get("collection1")) {
-      assertTrue("fail check for replica:" + url + " in " + replicas,
-          replicas.contains(stripTrailingSlash(url)));
+    if (cloudClient.isUpdatesToLeaders()) {
+      // compare leaders list
+      assertEquals(2, cloudClient.getLeaderUrlLists().get("collection1").size());
+      HashSet<String> leaderUrlSet = new HashSet<String>();
+      leaderUrlSet.addAll(cloudClient.getLeaderUrlLists().get("collection1"));
+      assertTrue("fail check for leader:" + shard1Leader.url + " in "
+          + leaderUrlSet, leaderUrlSet.contains(shard1Leader.url + "/"));
+      assertTrue("fail check for leader:" + shard2Leader.url + " in "
+          + leaderUrlSet, leaderUrlSet.contains(shard2Leader.url + "/"));
+      
+      // compare replicas list
+      Set<String> replicas = new HashSet<String>();
+      List<CloudJettyRunner> jetties = shardToJetty.get("shard1");
+      for (CloudJettyRunner cjetty : jetties) {
+        replicas.add(cjetty.url);
+      }
+      jetties = shardToJetty.get("shard2");
+      for (CloudJettyRunner cjetty : jetties) {
+        replicas.add(cjetty.url);
+      }
+      replicas.remove(shard1Leader.url);
+      replicas.remove(shard2Leader.url);
+      
+      assertEquals(replicas.size(),
+          cloudClient.getReplicasLists().get("collection1").size());
+      
+      for (String url : cloudClient.getReplicasLists().get("collection1")) {
+        assertTrue("fail check for replica:" + url + " in " + replicas,
+            replicas.contains(stripTrailingSlash(url)));
+      }
     }
     
   }



Mime
View raw message