Repository navigation
Drop deleted-only manifests when overwriting files - #4167
Open
max-parke-scale wants to merge 1 commit into
Open
max-parke-scale wants to merge 1 commit into
max-parke-scale wants to merge 1 commit into
Conversation
_OverwriteFiles._existing_manifests kept every parent manifest with no live files: reading one with discard_deleted=True returns no entries, so it took the "nothing to delete" branch. Each explicit-delete overwrite therefore added a manifest that every later commit and scan opened. Skip parent manifests with no added or existing files, as Java's MergingSnapshotProducer does. Closes apache#4165 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Closes #4165
Rationale for this change
_OverwriteFiles._existing_manifestskeeps every parent manifest that has no live files. It reads each manifest withdiscard_deleted=True, so a manifest whose entries are all DELETED comes back empty and takes the "nothing to delete" branch. Each overwrite also writes a manifest for its own deletions, so with explicitdelete_data_fileoverwrites the manifest list grows by one per commit and every later commit and scan opens all of them. In one production table this reached 388 manifests, 387 of them deleted-only.This skips parent manifests with no added or existing files before reading them, the rule Java applies in
MergingSnapshotProducer.apply. Earlier snapshots keep their own manifest lists, so time travel is unaffected, and each new snapshot still lists the manifest recording its own deletions.Are these changes tested?
Yes.
test_overwrite_drops_manifests_without_live_filesruns three overwrites and checks that each snapshot lists two manifests and that the first snapshot still reads its own row; onmainthe counts are[2, 3, 4]. The unit suite andprekpass.Are there any user-facing changes?
No API change. Tables written with explicit-delete overwrites stop accumulating deleted-only manifests, and existing tables shed them on their next overwrite.
🧑💻🤖 — posted via Claude Code