Skip to content

fix: support REST branches with distinct catalog identities - #1109

Open
shyjsarah wants to merge 1 commit into
apache:mainfrom
shyjsarah:fix/rest-branch-distinct-identity
Open

shyjsarah wants to merge 1 commit into
apache:mainfrom
shyjsarah:fix/rest-branch-distinct-identity

Conversation

@shyjsarah

Copy link
Copy Markdown
Contributor

Purpose

REST catalogs may represent a branch as a distinct catalog entity with its own UUID. Table::copy_with_branch currently compares the target branch UUID with the loaded handle UUID, which rejects that valid model even when both resolve to the same table location.

Changes

  • Verify that the source REST handle still resolves to the UUID it was loaded with before switching branches.
  • Resolve the source identity and target branch concurrently.
  • Keep the existing location check so a branch resolving to another table location is still rejected.
  • Cover distinct branch identities and stale source branch handles in the REST catalog integration tests.

Safety and compatibility

Catalogs that reuse the base table UUID for branch responses continue to work. A stale source handle is still rejected by UUID, and a target at another location is still rejected.

The REST response does not expose an explicit parent-table identity, so this keeps the existing table-location check as the branch membership boundary while moving UUID freshness validation to the source handle.

Verification

  • cargo fmt --all -- --check
  • cargo check -p paimon --all-targets --features fulltext,vortex
  • cargo clippy -p paimon --all-targets --features fulltext,vortex -- -D warnings
  • cargo test -p paimon --test rest_catalog_test test_branch_write_copy_loads_catalog_schema_with_distinct_identity -- --exact --test-threads=1
  • cargo test -p paimon --test rest_catalog_test test_branch_write_copy_rejects_replaced_source_identity_or_location -- --exact --test-threads=1

@QuakeWang QuakeWang left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

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.

2 participants