Repository navigation
fix(spec): mark stale snapshot errors in add_snapshot as retryable conflicts - #17
Merged
Merged
Conversation
…nflicts A snapshot whose sequence number is not above the table's last sequence number (format version 2 and later, with a parent), or whose first-row-id is behind the table's next-row-id (format version 3), was built on outdated table metadata: another commit, for example on another branch, advanced the table-wide counters. A reload and a new attempt commits. Both errors are now ErrorKind::CatalogCommitConflicts with retryable set, as requirement failures already are, so a catalog can answer them with 409 and Transaction::commit retries them. This mirrors Iceberg Java's RetryableValidationException (apache/iceberg#15126, Java 1.11). All other add_snapshot errors stay DataInvalid; an existing snapshot id is checked first, so a resend of a landed snapshot is not retried.
This was referenced Nov 2, 2026
Merged
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.
A rewrite can now remove delete files. The rewrite commit check now refuses a commit only for new deletes that apply to the replaced files. Four fixes make rewrites and scans handle partitions correctly after schema and spec changes. Review commit by commit.
Commits
RewriteFilesAction::delete_delete_fileremoves a position delete file, an equality delete file or a deletion vector, as Java'sRewriteFiles.deleteFile(DeleteFile)does. A rewrite that only removes delete files commits areplacesnapshot. Delete files are matched by path, content offset and content size, so removing one deletion vector keeps the other vectors in the same Puffin file. A delete file given todelete_file, or a data file given todelete_delete_file, is refused with an error that names the right method. Known limitation for format v3: a removed deletion vector is counted in the summary as a position delete file with its Puffin file size. Java counts it underremoved-dvswith its blob size. The action comes from feat(transaction): add MergingSnapshotProducer and RewriteFilesAction apache/iceberg-rust#3046 (open); upstream needs delete-only rewrites there first.validateNoNewDeletesForDataFiles. It refuses only for a new position delete or deletion vector that names a replaced file, or a new partition-scoped delete in the partition of a replaced file. Equality deletes newer thandata_sequence_numberare skipped when they still apply to the added files. Unlike Java, the check does not prune by column bounds. The rewrite is now always refused when its starting snapshot is not an ancestor of the current snapshot, as in Java.inttolongorfloattodoublepromotion. Without it, filtered scans pruned matching files, and deletes did not match data files from before the promotion. A conflict indata_file.rswas resolved by keeping both sides.row_deltaandoverwritealready do. Readers widen the values since fix(expr): widen promoted partition values and bounds to prevent false pruning apache/iceberg-rust#3483.PartitionSpec::is_unpartitioned(), as Java does. This follows fix(scan): apply equality deletes from an all-void partition spec globally apache/iceberg-rust#3449 (open) line for line, with JeonDaehong as co-author. One extra test checks that an identity spec with a null value stays partition-scoped.initial-defaultcase (Equality deletes ignore spec projection rules for dropped and newly added delete columns apache/iceberg-rust#3369) is not included.Tests
Each commit builds and passes
cargo test -p iceberg --all-features --lib. For each fix, the main tests fail without it. New tests:test_rewrite_files_removes_a_position_delete_file,..._removes_an_equality_delete_file,..._removes_one_deletion_vector_of_a_puffin_file,..._refuses_invalid_delete_file_removals,..._missing_delete_file,test_validate_duplicate_files_without_added_files_reads_no_manifest;test_rewrite_files_rejects_only_new_deletes_for_replaced_files(a table of 14 cases),..._ignores_delete_manifests_rewritten_since_the_start,..._rejects_new_deletes_in_rewritten_delete_manifests,..._rejects_starting_snapshot_off_the_branch,test_may_be_same_partition;test_rewrite_files_rewrites_a_manifest_written_before_a_promotion,test_rewrite_files_after_dropping_an_old_partition_source;test_void_spec_equality_delete_is_global,test_identity_spec_null_partition_equality_delete_stays_scoped;test_eq_delete_on_identity_partition_column_absent_from_data_file,test_eq_delete_on_uuid_partition_column_absent_from_data_file,test_eq_delete_on_absent_partition_column_with_unwidened_value.The cherry-pick brings its upstream tests.
Compatibility
RewriteFilesAction::delete_delete_file. No public item is removed or changed.