Skip to content

feat(transaction): add OverwriteAction with CoW delete support#2185

Open
glitchy wants to merge 1 commit intoapache:mainfrom
glitchy:feat/overwrite-action
Open

feat(transaction): add OverwriteAction with CoW delete support#2185
glitchy wants to merge 1 commit intoapache:mainfrom
glitchy:feat/overwrite-action

Conversation

@glitchy
Copy link

@glitchy glitchy commented Feb 26, 2026

Which issue does this PR close?

Part of #2186

This is the first in a series of PRs working toward full Copy-on-Write (CoW) and Merge-on-Read (MoR) support. CoW comes first because it provides the foundation that MoR eventually depends on. This PR delivers complete CoW overwrite semantics. Subsequent PRs will add RowDeltaAction for writing position/equality delete files (MoR write path), scan-side delete file reconciliation (MoR read path), and compaction.

Adds OverwriteAction, a new TransactionAction that produces snapshots with Operation::Overwrite semantics. It adds new data files and optionally removes existing data files by rewriting affected manifests with entries marked as ManifestStatus::Deleted.

Supporting changes:

  • ManifestWriter::add_deleted_entry()--the existing add_entry() unconditionally sets status to Added; there was no way to write deleted entries
  • SnapshotProducer::snapshot_id() getter--needed to stamp the snapshot ID on deleted manifest entries
  • FastAppendAction::existing_manifest() now preserves delete-only manifests so that deleted entries produced by OverwriteAction survive subsequent appends

Are these changes tested?

5 new unit tests in transaction::overwrite::tests:

  • test_empty_data_overwrite_action--error on empty file list
  • test_overwrite_snapshot_properties--custom properties flow to snapshot summary
  • test_overwrite_incompatible_partition_value--rejects mismatched partition types
  • test_overwrite_basic--verifies updates, requirements, operation type, manifest structure, sequence numbers
  • test_overwrite_with_deleted_files--end-to-end: append via catalog, overwrite with deletes via catalog, verify original file is Deleted and replacement is Added

@glitchy glitchy changed the title add OverwriteAction with CoW delete support feat(transaction): add OverwriteAction with CoW delete support Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant