Skip to content

fix(dataset): prevent deleting branches referenced by tags - #8365

Open
dentiny wants to merge 1 commit into
lance-format:mainfrom
dentiny:hjiang/not-delete-branch
Open

fix(dataset): prevent deleting branches referenced by tags#8365
dentiny wants to merge 1 commit into
lance-format:mainfrom
dentiny:hjiang/not-delete-branch

Conversation

@dentiny

@dentiny dentiny commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Closes #8366

Hi team, I found when we delete a branch, we (1) didn't check whether there're referencing tags and reject; nor (2) delete all tags referencing the branch, which leads to dangling tag.

In this PR, I choose to implement the former approach, which is conservative and safe.
For the later (delete all referencing tags), I think it's unsafe, because the tag could be created by another users and cause unintended results.

Update on the bot gatekeeper comment: I think fully preventing this requires a shared CAS or generation protocol across branch and tag metadata, which is outside this PR’s scope, could be a followup though.

@github-actions github-actions Bot added the bug Something isn't working label Aug 7, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Gate recommendation: approve with a non-blocking risk.

The reject-on-reference guard preserves user-managed tags and prevents sequential branch deletion from invalidating them, with focused coverage for both rejection and the successful cleanup path.

Tag and branch reference mutations still use independent object-store operations, so concurrent tag creation or retargeting can race deletion. A shared CAS/generation protocol would be needed for a strict no-dangling guarantee; this change is still a worthwhile safety improvement within the current non-atomic reference model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dangling tags after branch gets deleted

1 participant