fix: recover from stale cached manifest size on read#7542
Merged
Conversation
wjones127
approved these changes
Jun 30, 2026
Comment on lines
+118
to
+119
| // A cached size can be stale; if the index read fails with it, retry | ||
| // with the true size. |
Contributor
There was a problem hiding this comment.
note: the only way this can happen AFAIK is the table has been deleted and re-created between the LIST call to get the latest location and then reading the manifest.
| let section = | ||
| match read_index_section(object_store, &location.path, location.size, *pos).await { | ||
| Ok(section) => section, | ||
| Err(_) if location.size.is_some() => { |
Contributor
There was a problem hiding this comment.
suggestion: it would be nice to match on the "file size is too small" error.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Resolving the latest version records the manifest size from the listing so the read can skip a metadata call. If the table is dropped and recreated between that listing and the read, the path points at a different object and the cached size no longer matches. read_manifest already retries without the cached size when it looks wrong; the open path did not, so a stale size surfaced as a spurious "file size is too small" error. Apply the same fallback in load_manifest and read_manifest_indexes, and guard read_message against slicing a truncated buffer so the retry has a clean error to match on. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
wkalt
force-pushed
the
fix/manifest-read-retry
branch
from
July 1, 2026 00:02
6dfed32 to
7382c96
Compare
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.
ManifestLocation caches a file size to skip a metadata call, but it can lag the real object under concurrent commits. read_manifest already retries without the cached size; the open path did not, so a stale size surfaced as a spurious "file size is too small" error.
Apply the same fallback in load_manifest and read_manifest_indexes, and guard read_message's length-prefix slice against a truncated read.