From 1641ccea60965caca5501a17799f4edfa0e843c5 Mon Sep 17 00:00:00 2001 From: Mark Robert Miller Date: Sat, 30 Nov 2013 03:03:44 +0000 Subject: [PATCH] SOLR-5516: wait a moment before trying to Sync git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1546683 13f79535-47bb-0310-9956-ffa450edef68 --- .../core/src/java/org/apache/solr/cloud/SyncStrategy.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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 4c104269506..0b5a67a44df 100644 --- a/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java +++ b/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java @@ -27,6 +27,7 @@ import org.apache.solr.client.solrj.SolrServerException; import org.apache.solr.client.solrj.impl.HttpSolrServer; import org.apache.solr.client.solrj.request.CoreAdminRequest.RequestRecovery; import org.apache.solr.common.SolrException; +import org.apache.solr.common.SolrException.ErrorCode; import org.apache.solr.common.cloud.ZkCoreNodeProps; import org.apache.solr.common.cloud.ZkNodeProps; import org.apache.solr.common.cloud.ZkStateReader; @@ -93,6 +94,13 @@ public class SyncStrategy { log.error("No UpdateLog found - cannot sync"); return false; } + // wait a second for any floating updates to finish + try { + Thread.sleep(1500); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new SolrException(ErrorCode.SERVICE_UNAVAILABLE, e); + } success = syncReplicas(zkController, core, leaderProps); } finally { SolrRequestInfo.clearRequestInfo();