Skip to content

[core] Prevent tag deletion when referenced by branches - #8854

Draft
ArnavBalyan wants to merge 1 commit into
apache:masterfrom
ArnavBalyan:arnavb/tag-del
Draft

[core] Prevent tag deletion when referenced by branches#8854
ArnavBalyan wants to merge 1 commit into
apache:masterfrom
ArnavBalyan:arnavb/tag-del

Conversation

@ArnavBalyan

Copy link
Copy Markdown
Member

Purpose

  • A branch created from a tag shares the tag snapshot's data and manifest files. Deleting the tag makes the branch unqueryable.
  • Block deleteTag with an error with referencing branches, so a tag cannot be removed while a branch depends on it.
  • Make automatic tag expiration skip such tags with a warning instead, since it runs during commit and must not fail the commit.
  • Supported for FileSystemBranchManager and CatalogBranchManager.

Tests

  • UT

@JingsongLi

Copy link
Copy Markdown
Contributor

After a branch is created from tag1, a branch-local tag1 is saved; after the main branch renames tag1 to tag2, branchesCreatedFromTag(“tag2”) cannot find the branch-local tag2, so deleteTag(“tag2”) can still be executed and delete the shared file, potentially making the branch unreadable again. Reference relationships cannot be determined based solely on tag names; at a minimum, renaming of referenced tags must be prevented, or associations must be persisted via snapshot or origin.

@ArnavBalyan
ArnavBalyan marked this pull request as draft July 29, 2026 07:10
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