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
This commit is contained in:
Mark Robert Miller 2013-11-30 03:03:44 +00:00
parent a6eb226481
commit 1641ccea60
1 changed files with 8 additions and 0 deletions

View File

@ -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();