Repository navigation
SOLR-18684: Retry IO errs on backup+restore copying - #5387
Conversation
Prior to this commit Solr's backup/restore framework had no consistent support for retrying IO errors. This caused lots of problems for users with large indices: a restore or installshard might copy 100s of GB and fail on the very last file due to a single connection-drop. This commit addresses this problem by adding retry logic at the framework level. Solr will retry certain IOExceptions `solr.backup.maxcopyretries` times (defaults to 2), giving users a bit of protection against tiny network blips failing such long, expensive processes.
|
Automated PR readiness judgements (LLM-generated; may be wrong; not updated on later pushes).
|
|
(Tests and check pass locally for me 👍 ) |
mlbiscoc
left a comment
There was a problem hiding this comment.
I do s3 backups a decent amount and I think I ran into these transient network failures before and I think this would help but doesn't the the S3StorageClient have it's own retry strategy? Will these overlap?
| * is 0. | ||
| */ | ||
| private static BackupRepository withRetries(BackupRepository repo) { | ||
| int maxRetries = EnvUtils.getPropertyAsInteger(MAX_COPY_RETRIES_PROP, 2); |
There was a problem hiding this comment.
I like if these are static finals instead and call it like MAX_COPY_RETRIES instead of placing the (default 2) in comments. Then if this ever changes people update comments which is kind of awkward.
| if (maxRetries <= 0) { | ||
| return repo; | ||
| } | ||
| long backoffMillis = EnvUtils.getPropertyAsLong(COPY_RETRY_BACKOFF_MILLIS_PROP, 1000L); |
There was a problem hiding this comment.
We should protect against negative backoff times like we you did above. Also same as comment above, static final for the defautl backoff time and we don't need this comment (default 1000).
It does! I didn't get into this in the JIRA ticket, but maybe it's worth expanding on. S3StorageClient has retries you can configure, but AFAICT they only cover codepaths within S3StorageClient and the s3 library code. Once the client has returned a stream object and Solr's code is consuming it the s3 level retries don't come into play, which really stinks 😦 |
Prior to this commit Solr's backup/restore framework had no consistent support for retrying IO errors. This caused lots of problems for users with large indices: a restore or installshard might copy 100s of GB and fail on the very last file due to a single connection-drop. This commit addresses this problem by adding retry logic at the framework level. Solr will retry certain IOExceptions `solr.backup.maxcopyretries` times (defaults to 2), giving users a bit of protection against tiny network blips failing such long, expensive processes. (cherry picked from commit 6d2a8dd)
Prior to this commit Solr's backup/restore framework had no consistent support for retrying IO errors. This caused lots of problems for users with large indices: a restore or installshard might copy 100s of GB and fail on the very last file due to a single connection-drop. This commit addresses this problem by adding retry logic at the framework level. Solr will retry certain IOExceptions `solr.backup.maxcopyretries` times (defaults to 2), giving users a bit of protection against tiny network blips failing such long, expensive processes. (cherry picked from commit 6d2a8dd) (cherry picked from commit 3ba107f)
Prior to this commit Solr's backup/restore framework had no consistent support for retrying IO errors. This caused lots of problems for users with large indices: a restore or installshard might copy 100s of GB and fail on the very last file due to a single connection-drop. This commit addresses this problem by adding retry logic at the framework level. Solr will retry certain IOExceptions `solr.backup.maxcopyretries` times (defaults to 2), giving users a bit of protection against tiny network blips failing such long, expensive processes. (cherry picked from commit 6d2a8dd) (cherry picked from commit 3ba107f) (cherry picked from commit a333df8)
https://issues.apache.org/jira/browse/SOLR-18684
Description
Prior to this commit Solr's backup/restore framework had no consistent support for retrying IO errors. This caused lots of problems for users with large indices: a restore or installshard might copy 100s of GB and fail on the very last file due to a single connection-drop.
Solution
This commit addresses this problem by adding retry logic at the framework level. Solr will retry certain IOExceptions
solr.backup.maxcopyretriestimes (defaults to 2), giving users a bit of protection against tiny network blips failing such long, expensive processes.Tests
See RetryingBackupRepositoryTest. Existing tests continue to pass.
Checklist
Please review the following and check all that apply: