feat: add CherryPickOperation and wire SnapshotManager::Cherrypick - #926
Open
shangxinli wants to merge 1 commit into
Open
feat: add CherryPickOperation and wire SnapshotManager::Cherrypick#926shangxinli wants to merge 1 commit into
shangxinli wants to merge 1 commit into
Conversation
Implements cherry-picking an append or dynamic partition overwrite onto the current state, with source-snapshot-id and WAP publish tracking, non-ancestor and replaced-partition validation. SnapshotManager routes fast-forwardable picks to SetSnapshot, since those produce no snapshot. Closes the CherryPickOperation item in apache#637.
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.
Adds
CherryPickOperationand implementsSnapshotManager::Cherrypick(), which was a TODO stub.Follows Java's
CherryPickOperation: appends re-apply their added files, dynamic overwrites (replace-partitions) re-apply adds and deletes and are rejected if a replaced partition changed, and anything else can only be fast-forward. Recordssource-snapshot-idandpublished-wap-id, and rejects a WAP id that was already published.Like Java, the operation is reachable only through
Transaction, notTable.One divergence worth a look:
Apply()here always builds a new snapshot, so it cannot express Java's fast-forward, which returns an existing one.SnapshotManagerinstead routes a fast-forward toSetSnapshot, with the predicate inSnapshotUtil::CanFastForward()so there is a single definition.SetSnapshot::RequireFastForward()re-checks it at apply time so a commit retry cannot silently turn the fast-forward into a branch move.14 tests ported from Java
TestSnapshotManagerandTestWapWorkflow.Part of #637.