use of org.neo4j.causalclustering.catchup.storecopy.StoreIdDownloadFailedException in project neo4j by neo4j.
the class ReadReplicaStartupProcess method start.
@Override
public void start() throws IOException {
boolean syncedWithUpstream = false;
RetryStrategy.Timeout timeout = retryStrategy.newTimeout();
int attempt = 0;
while (!syncedWithUpstream) {
attempt++;
MemberId source = null;
try {
source = selectionStrategyPipeline.bestUpstreamDatabase();
syncStoreWithUpstream(source);
syncedWithUpstream = true;
} catch (UpstreamDatabaseSelectionException e) {
lastIssue = issueOf("finding upstream member", attempt);
debugLog.warn(lastIssue);
} catch (StoreCopyFailedException e) {
lastIssue = issueOf(format("copying store files from %s", source), attempt);
debugLog.warn(lastIssue);
} catch (StreamingTransactionsFailedException e) {
lastIssue = issueOf(format("streaming transactions from %s", source), attempt);
debugLog.warn(lastIssue);
} catch (StoreIdDownloadFailedException e) {
lastIssue = issueOf(format("getting store id from %s", source), attempt);
debugLog.warn(lastIssue);
}
try {
Thread.sleep(timeout.getMillis());
timeout.increment();
} catch (InterruptedException e) {
Thread.interrupted();
lastIssue = "Interrupted while trying to start read replica";
debugLog.warn(lastIssue);
break;
}
}
if (!syncedWithUpstream) {
userLog.error(lastIssue);
throw new RuntimeException(lastIssue);
}
try {
localDatabase.start();
txPulling.start();
} catch (Throwable e) {
throw new RuntimeException(e);
}
}
Aggregations