lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject [24/50] [abbrv] lucene-solr:jira/http2: SOLR-12670: RecoveryStrategy logs wrong wait time when retrying recovery
Date Tue, 21 Aug 2018 01:30:51 GMT
SOLR-12670: RecoveryStrategy logs wrong wait time when retrying recovery


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

Branch: refs/heads/jira/http2
Commit: 887055d892e67a61bdad61daf8075094762f0f39
Parents: 100b151
Author: Shalin Shekhar Mangar <shalin@apache.org>
Authored: Thu Aug 16 15:00:49 2018 +0530
Committer: Shalin Shekhar Mangar <shalin@apache.org>
Committed: Thu Aug 16 15:00:49 2018 +0530

----------------------------------------------------------------------
 solr/CHANGES.txt                                             | 2 ++
 .../src/java/org/apache/solr/cloud/RecoveryStrategy.java     | 8 +++++---
 2 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/887055d8/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 82f8453..3460bc7 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -239,6 +239,8 @@ Bug Fixes
 
 * SOLR-12649: CloudSolrClient retries requests unnecessarily exception from server (noble,
shalin)
 
+* SOLR-12670: RecoveryStrategy logs wrong wait time when retrying recovery. (shalin)
+
 Optimizations
 ----------------------
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/887055d8/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java b/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
index 5de9581..f361324 100644
--- a/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
+++ b/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
@@ -24,6 +24,7 @@ import java.util.Arrays;
 import java.util.List;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
 
 import org.apache.http.client.methods.HttpUriRequest;
 import org.apache.lucene.search.MatchAllDocsQuery;
@@ -422,11 +423,12 @@ public class RecoveryStrategy implements Runnable, Closeable {
 
       try {
         // Wait an exponential interval between retries, start at 5 seconds and work up to
a minute.
-        // If we're at attempt >= 4, there's no point computing pow(2, retries) because
the result 
+        // If we're at attempt >= 4, there's no point computing pow(2, retries) because
the result
         // will always be the minimum of the two (12). Since we sleep at 5 seconds sub-intervals
in
         // order to check if we were closed, 12 is chosen as the maximum loopCount (5s *
12 = 1m).
-        double loopCount = retries < 4 ? Math.min(Math.pow(2, retries), 12) : 12;
-        LOG.info("Wait [{}] seconds before trying to recover again (attempt={})", loopCount,
retries);
+        int loopCount = retries < 4 ? (int) Math.min(Math.pow(2, retries), 12) : 12;
+        LOG.info("Wait [{}] seconds before trying to recover again (attempt={})",
+            TimeUnit.MILLISECONDS.toSeconds(loopCount * startingRecoveryDelayMilliSeconds),
retries);
         for (int i = 0; i < loopCount; i++) {
           if (isClosed()) {
             LOG.info("Recovery for core {} has been closed", core.getName());


Mime
View raw message