[rest] Remove renameBranch REST endpoint#8023
Open
qingwei727 wants to merge 1 commit into
Open
Conversation
Strip the client-side renameBranch call, its request path, and the RenameBranchRequest payload. RESTCatalog now throws UnsupportedOperationException for renameBranch to satisfy the Catalog interface. Mock server and tests updated accordingly.
2e1a09c to
3691ea1
Compare
Member
|
+1. For object storage backends, renameBranch cannot be implemented
atomically given the current branch structure, and silently doing a
non-atomic rename is worse than throwing UnsupportedOperationException.
Removing it from the REST surface prevents implementors from providing a
broken API.
|
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.
Purpose
The server-side implementation of
renameBranchultimately relies on theunderlying object store's rename (e.g. OSS), which is not atomic. While
the rename is in progress, concurrent writes to the source branch can be
silently lost, and there is currently no reliable way for the server to
fence those writes during the operation.
Because of this consistency risk, we'd rather not offer
renameBranchoverthe REST catalog at all than offer it with a known data-loss window. This
PR retires only the REST surface — the
Cataloginterface and the non-RESTimplementations (file-system branch manager, Spark/Flink procedures, etc.)
are intentionally left untouched, so users on those code paths are not
affected.
Tests
RESTCatalogTest#testBranches