feat(transaction): add ManageSnapshotsAction for snapshot refs. (#1939)#2709
Open
hippalus wants to merge 1 commit into
Open
feat(transaction): add ManageSnapshotsAction for snapshot refs. (#1939)#2709hippalus wants to merge 1 commit into
hippalus wants to merge 1 commit into
Conversation
…he#1939) Create, remove, replace, rename, fast-forward branches/tags and set per-ref retention in a transaction, with diff-based updates and requirements.
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.
Which issue does this PR close?
What changes are included in this PR?
Adds
ManageSnapshotsAction, a transaction action for managing branches and tags (like Java'sManageSnapshots). PR1 of #1939 ref management only, no rollback/set-current-snapshot/cherrypick.Transaction::manage_snapshots()supports:create_branch/create_tagremove_branch/remove_tagrename_branchreplace_branch(by id) /replace_branch_with_ref(by ref) /replace_tagfast_forward_branchset_min_snapshots_to_keep/set_max_snapshot_age_ms(branch-only) /set_max_ref_age_msNotes:
RefSnapshotIdMatch.SetSnapshotRef/RemoveSnapshotRef+UuidMatch/RefSnapshotIdMatchno new variants.Supporting changes:
TableMetadata::refs()andsnapshot_reference()accessors.util::snapshot::is_ancestor_of()(used by fast-forward).TableMetadataBuilder::set_ref()rejects settingmainto a tag (Java parity).Are these changes tested?
Yes unit tests in
manage_snapshots.rs, following theexpire_snapshots.rsstyle:main, non-ancestor fast-forward, negative retention, …).TableMetadataBuilder.main-as-tag rejection is covered by a test intable_metadata_builder.rs.