hippalus opened a new pull request, #2709:
URL: https://github.com/apache/iceberg-rust/pull/2709

   ## Which issue does this PR close?
   
   - Closes #1939.
   
   ## What changes are included in this PR?
   
   Adds `ManageSnapshotsAction`, a transaction action for managing branches and 
tags (like Java's `ManageSnapshots`). PR1 of #1939 ref management only, no 
rollback/set-current-snapshot/cherrypick.
   
   `Transaction::manage_snapshots()` supports:
   
   - `create_branch` / `create_tag`
   - `remove_branch` / `remove_tag`
   - `rename_branch`
   - `replace_branch` (by id) / `replace_branch_with_ref` (by ref) / 
`replace_tag`
   - `fast_forward_branch`
   - `set_min_snapshots_to_keep` / `set_max_snapshot_age_ms` (branch-only) / 
`set_max_ref_age_ms`
   
   Notes:
   
   - Validation runs at commit time, against a working copy of the refs map 
(chained ops see intermediate state).
   - Updates/requirements are diff-based against the current refs, net no-ops 
emit nothing, concurrent ref changes are caught via `RefSnapshotIdMatch`.
   - Reuses existing `SetSnapshotRef`/`RemoveSnapshotRef` + 
`UuidMatch`/`RefSnapshotIdMatch` no new variants.
   
   Supporting changes:
   
   - `TableMetadata::refs()` and `snapshot_reference()` accessors.
   - `util::snapshot::is_ancestor_of()` (used by fast-forward).
   - `TableMetadataBuilder::set_ref()` rejects setting `main` to a tag (Java 
parity).
   
   ## Are these changes tested?
   
   Yes unit tests in `manage_snapshots.rs`, following the `expire_snapshots.rs` 
style:
   
   - One test per operation plus its failure cases (missing/duplicate refs, 
wrong ref kind, removing/renaming `main`, non-ancestor fast-forward, negative 
retention, …).
   - Diff/requirement behavior: minimal diffs from chained ops, transient refs 
get no requirement, source-ref concurrency assertions, round-trip through 
`TableMetadataBuilder`.
   - The `main`-as-tag rejection is covered by a test in 
`table_metadata_builder.rs`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to