SOLR-3180: wait for leader to see our recovering state before peer sync as well

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1425342 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2012-12-22 21:06:04 +00:00
parent 3340abc8dd
commit c8f34f9f78
1 changed files with 12 additions and 11 deletions

View File

@ -341,6 +341,18 @@ public class RecoveryStrategy extends Thread implements ClosableThread {
}
zkController.publish(core.getCoreDescriptor(), ZkStateReader.RECOVERING);
sendPrepRecoveryCmd(leaderBaseUrl, leaderCoreName);
// we wait a bit so that any updates on the leader
// that started before they saw recovering state
// are sure to have finished
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
// first thing we just try to sync
if (firstTime) {
@ -388,17 +400,6 @@ public class RecoveryStrategy extends Thread implements ClosableThread {
log.info("Starting Replication Recovery. core=" + coreName);
sendPrepRecoveryCmd(leaderBaseUrl, leaderCoreName);
// we wait a bit so that any updates on the leader
// that started before they saw recovering state
// are sure to have finished
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
log.info("Begin buffering updates. core=" + coreName);
ulog.bufferUpdates();
replayed = false;