Repository navigation
SOLR-18684: Retry IO errs on backup+restore copying - #5387
gerlowskija wants to merge 1 commit into
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).
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: