fix(cleanup): add retry logic to manifest reads and per-manifest error tolerance#4
Merged
Merged
Conversation
…r tolerance Three targeted fixes for S3 mid-stream body failures during cleanup: 1. read_manifest() now retries get_range() calls using the existing download_retry_count (default 3). Previously, manifest reads called object_store.inner.get_range() directly with no retry, while the CloudObjectReader path had retry via do_get_with_outer_retry(). Failed reads now log the full error details via log::warn/info. 2. process_manifests() no longer aborts on the first manifest read failure. Instead, it collects failures and retries them in up to 3 additional rounds. Only if manifests still fail after all retry rounds does the cleanup abort with a detailed error listing all failed paths and their errors. 3. ObjectStore.download_retry_count() is now public, allowing lance-table to access the configured retry count. Co-Authored-By: Jan van der Vegt <jan@exa.ai>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
ACTION NEEDED The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification. For details on the error please inspect the "PR Title Check" action. |
dpruijt
approved these changes
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes S3 mid-stream body download failures that cause
cleanup_old_versions()to fail on large lance tables with thousands of manifests (7,600+ in our case). The cleanup reads every manifest file concurrently, and a single transient S3 error during body streaming kills the entire operation — which then takes ~49 minutes to restart from scratch.Three targeted changes:
1.
read_manifest()now retriesget_range()calls (rust/lance-table/src/io/manifest.rs)Previously,
read_manifest()calledobject_store.inner.get_range()directly — no retry on any failure. Meanwhile,read_manifest_indexes()goes throughCloudObjectReaderwhich hasdo_get_with_outer_retry()(retries body-streaming failures up todownload_retry_counttimes). This was an asymmetry — the function added (get_range_with_retry) follows the same pattern and logs full error details vialog::warn/log::infoon failure/retry.2.
process_manifests()no longer aborts on first error (rust/lance/src/dataset/cleanup.rs)Replaced
try_for_each_concurrent(which aborts the entire stream on the first error) withfor_each_concurrentthat collects failures, then retries them in up to 3 additional rounds. With ~7,600 manifests and 64 concurrent reads, the probability of at least one transient failure is high. Now a single failure doesn't waste the ~49 minutes of work from all the successful reads.3.
ObjectStore.download_retry_count()exposed as public (rust/lance-io/src/object_store.rs)The field was private; added a public getter so
lance-tablecan access the configured retry count for manifest reads.Review & Testing Checklist for Human
get_range_with_retryhandles allobject_store::Errorvariants correctly (not just body-streaming failures) — retrying on non-transient errors (e.g., 404 NotFound) is wasteful but not harmful since the retry count is low (default 3)cleanup_old_versions()against a real large lance table on S3 (atlas.lance with ~7,600 manifests) to validate end-to-end behaviorprocess_manifestsretry rounds work correctly by checking logs for "Retry round" messages when a manifest read fails transientlyCleanupInspectionmutex — the retry only processes the failedManifestLocations)Notes
The root cause is that the upstream
object_storecrate strips the actual underlying error (connection reset, timeout, etc.) behind a generic "HTTP error: request or response body error" message. Thelog::warn!inget_range_with_retryuses{:?}(Debug format) which preserves the full error chain including the underlying cause, providing much better diagnostics than the defaultDisplayformat.Link to Devin session: https://app.devin.ai/sessions/bb810ab5769542e0a12b08c2505d2ae1
Requested by: @jan-exa