From 8edc462ec1a24fddeb349c59f776fd186c6fd78f Mon Sep 17 00:00:00 2001 From: Mark Robert Miller Date: Sun, 22 Mar 2015 16:04:46 +0000 Subject: [PATCH] SOLR-7141: RecoveryStrategy: Raise time that we wait for any updates from the leader before they saw the recovery state to have finished. git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1668396 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 3 +++ .../src/java/org/apache/solr/cloud/RecoveryStrategy.java | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 038267168d6..b509bfce41e 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -272,6 +272,9 @@ Bug Fixes * SOLR-7285: ActionThrottle will not pause if getNanoTime first returns 0. (Mark Miller, Gregory Chanan) + +* SOLR-7141: RecoveryStrategy: Raise time that we wait for any updates from the leader before + they saw the recovery state to have finished. (Mark Miller) Optimizations ---------------------- 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 688957a0f05..7d5836385fd 100644 --- a/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java +++ b/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java @@ -66,6 +66,7 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; public class RecoveryStrategy extends Thread implements ClosableThread { + private static final int WAIT_FOR_UPDATES_WITH_STALE_STATE_PAUSE = Integer.getInteger("solr.cloud.wait-for-updates-with-stale-state-pause", 7000); private static final int MAX_RETRIES = 500; private static final int STARTING_RECOVERY_DELAY = 5000; @@ -368,9 +369,10 @@ public class RecoveryStrategy extends Thread implements ClosableThread { // we wait a bit so that any updates on the leader // that started before they saw recovering state - // are sure to have finished + // are sure to have finished (see SOLR-7141 for + // discussion around current value) try { - Thread.sleep(2000); + Thread.sleep(WAIT_FOR_UPDATES_WITH_STALE_STATE_PAUSE); } catch (InterruptedException e) { Thread.currentThread().interrupt(); }