Search in sources :

Example 1 with StoreIdDownloadFailedException

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);
    }
}
Also used : MemberId(org.neo4j.causalclustering.identity.MemberId) StoreCopyFailedException(org.neo4j.causalclustering.catchup.storecopy.StoreCopyFailedException) StreamingTransactionsFailedException(org.neo4j.causalclustering.catchup.storecopy.StreamingTransactionsFailedException) StoreIdDownloadFailedException(org.neo4j.causalclustering.catchup.storecopy.StoreIdDownloadFailedException) RetryStrategy(org.neo4j.causalclustering.helper.RetryStrategy)

Aggregations

StoreCopyFailedException (org.neo4j.causalclustering.catchup.storecopy.StoreCopyFailedException)1 StoreIdDownloadFailedException (org.neo4j.causalclustering.catchup.storecopy.StoreIdDownloadFailedException)1 StreamingTransactionsFailedException (org.neo4j.causalclustering.catchup.storecopy.StreamingTransactionsFailedException)1 RetryStrategy (org.neo4j.causalclustering.helper.RetryStrategy)1 MemberId (org.neo4j.causalclustering.identity.MemberId)1