fix: enable branch creation on tables that uses lance-namespace#7403
Closed
dantasse wants to merge 1 commit into
Closed
fix: enable branch creation on tables that uses lance-namespace#7403dantasse wants to merge 1 commit into
dantasse wants to merge 1 commit into
Conversation
dantasse
marked this pull request as draft
June 22, 2026 22:20
jackye1995
pushed a commit
that referenced
this pull request
Jun 23, 2026
This PR picks up on the work in #7403 by @dantasse. `create_branch` on managed tables calls `create_table_version` before `_refs/branches/<branch>.json` exists, and `resolve_branch_location` requires that ref. Bootstrap commit fails. `create_table_version` now goes through `resolve_branch_for_commit` instead check the ref first, and if it's missing only allow the commit when the branch chain has no versions yet. Versions without a ref still get rejected (zombie). `create_branch("exp")` used to fail on the first commit because `create_table_version` looked for `_refs/branches/exp.json` before phase 2 wrote it. ``` # branching isn't atomic so: phase 1: manifest → create_table_version (ref doesn't exist yet ← was failing here) phase 2: write _refs/branches/exp.json ``` ### Testing - Added `test_create_branch_on_managed_dataset_succeeds`. - Zombie case is already in `test_branch_ops_reject_zombie_branch`. --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]> Co-authored-by: Cursor <[email protected]>
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.
Creating a branch fails on tables that use lance-namespace. On a lance-namespace table, this happens in order:
So step 2 fails because .json isn't written yet. (the commit handler mislabels this as "dataset already exists"). So this PR adds
resolve_branch_location_unchecked, which just computes the main branch's path and addstree/<branch>which is the right location.(On unmanaged tables, step 2 doesn't happen, so there's no problem.)
Edit: dir::tests::test_branch_ops_reject_zombie_branch fails; this isn't ready yet