fix(transaction): preserve delete-only manifests in fast_append#2149
Open
drbothen wants to merge 1 commit intoapache:mainfrom
Open
fix(transaction): preserve delete-only manifests in fast_append#2149drbothen wants to merge 1 commit intoapache:mainfrom
drbothen wants to merge 1 commit intoapache:mainfrom
Conversation
FastAppendAction::existing_manifest() filters which manifests from the current snapshot are carried forward to the new snapshot. The filter only checked has_added_files() and has_existing_files(), which drops manifests that contain only Deleted entries. After a rewrite_files operation, a delete-only manifest records which file paths were removed. If a subsequent fast_append drops this manifest, the deleted files reappear as alive in the new snapshot because the old manifests still carry their Added entries with no corresponding Delete entries to exclude them. This causes data duplication that compounds with each subsequent operation. Add has_deleted_files() to the filter so delete-only manifests survive across snapshot boundaries until expire_snapshots cleans them up.
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
FastAppendAction::existing_manifest()to carry forward delete-only manifestsfast_append, causing previously deleted files to reappear as live dataCloses #2148
Details
The
existing_manifest()filter checkedhas_added_files() || has_existing_files()but nothas_deleted_files(). A delete-only manifest (created by operations likerewrite_filesto record file removals) would be silently dropped on the nextfast_append, breaking snapshot isolation and causing compounding data duplication.The fix adds
|| entry.has_deleted_files()so delete-only manifests persist untilexpire_snapshotscleans them up, consistent with the Iceberg spec's requirement that delete tracking survives across snapshot boundaries.Test plan
fast_appendtests pass (cargo test -p iceberg --lib -- append)cargo test -p iceberg --lib— 1,211 tests)rewrite_files(planned for that PR)