You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2016/02/24 07:12:19 UTC

[12/53] [abbrv] lucene-solr git commit: SOLR-8656: PeerSync should use same nUpdates everywhere.

SOLR-8656: PeerSync should use same nUpdates everywhere.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/771f14cb
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/771f14cb
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/771f14cb

Branch: refs/heads/apiv2
Commit: 771f14cb6e476373e94169be05c1eadf816ca5b6
Parents: 8cd53a0
Author: markrmiller <ma...@apache.org>
Authored: Fri Feb 19 16:41:49 2016 -0500
Committer: markrmiller <ma...@apache.org>
Committed: Fri Feb 19 16:41:49 2016 -0500

----------------------------------------------------------------------
 solr/CHANGES.txt                                         |  2 ++
 .../src/java/org/apache/solr/cloud/SyncStrategy.java     | 11 ++++++-----
 2 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/771f14cb/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 035a1f6..e090126 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -190,6 +190,8 @@ Bug Fixes
 
 * SOLR-8633: DistributedUpdateProcess processCommit/deleteByQuery call finish on DUP and 
   SolrCmdDistributor, which violates the lifecycle and can cause bugs. (hossman via Mark Miller)
+  
+* SOLR-8656: PeerSync should use same nUpdates everywhere. (Ramsey Haddad via Mark Miller)
 
 Optimizations
 ----------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/771f14cb/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java b/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java
index 28b81bd..cedcff9 100644
--- a/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java
+++ b/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java
@@ -141,7 +141,7 @@ public class SyncStrategy {
       if (success) {
         log.info("Sync Success - now sync replicas to me");
         
-        syncToMe(zkController, collection, shardId, leaderProps, core.getCoreDescriptor());
+        syncToMe(zkController, collection, shardId, leaderProps, core.getCoreDescriptor(), core.getUpdateHandler().getUpdateLog().getNumRecordsToKeep());
         
       } else {
         log.info("Leader's attempt to sync with shard failed, moving to the next candidate");
@@ -181,7 +181,8 @@ public class SyncStrategy {
   }
   
   private void syncToMe(ZkController zkController, String collection,
-      String shardId, ZkNodeProps leaderProps, CoreDescriptor cd) {
+                        String shardId, ZkNodeProps leaderProps, CoreDescriptor cd,
+                        int nUpdates) {
     
     // sync everyone else
     // TODO: we should do this in parallel at least
@@ -199,7 +200,7 @@ public class SyncStrategy {
       try {
         log.info(ZkCoreNodeProps.getCoreUrl(leaderProps) + ": try and ask " + node.getCoreUrl() + " to sync");
         
-        requestSync(node.getBaseUrl(), node.getCoreUrl(), zkLeader.getCoreUrl(), node.getCoreName());
+        requestSync(node.getBaseUrl(), node.getCoreUrl(), zkLeader.getCoreUrl(), node.getCoreName(), nUpdates);
         
       } catch (Exception e) {
         SolrException.log(log, "Error syncing replica to leader", e);
@@ -250,7 +251,7 @@ public class SyncStrategy {
     return success;
   }
 
-  private void requestSync(String baseUrl, String replica, String leaderUrl, String coreName) {
+  private void requestSync(String baseUrl, String replica, String leaderUrl, String coreName, int nUpdates) {
     ShardCoreRequest sreq = new ShardCoreRequest();
     sreq.coreName = coreName;
     sreq.baseUrl = baseUrl;
@@ -260,7 +261,7 @@ public class SyncStrategy {
     sreq.params = new ModifiableSolrParams();
     sreq.params.set("qt","/get");
     sreq.params.set("distrib",false);
-    sreq.params.set("getVersions",Integer.toString(100));
+    sreq.params.set("getVersions",Integer.toString(nUpdates));
     sreq.params.set("sync",leaderUrl);
     
     shardHandler.submit(sreq, replica, sreq.params);