fix(namespace): allow create_branch bootstrap on managed tables#7415
Merged
Conversation
create_table_version resolves a branch via resolve_branch_for_commit: a branch chain accepts a commit when the BranchContents ref already exists or when the chain has no committed versions yet (the create_branch bootstrap, whose first commit precedes its ref). A chain with versions but no ref is a zombie and stays rejected. Adds test_create_branch_on_managed_dataset_succeeds; managed zombie rejection through create_table_version is already covered by test_branch_ops_reject_zombie_branch. Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
dantasse
approved these changes
Jun 23, 2026
dantasse
left a comment
There was a problem hiding this comment.
Cool, looks like a good solution to me!
…Windows create_table_version now writes and zombie-checks a branch at the same object-store Path from find_branch(), instead of round-tripping the branch URI through object_store_path_from_uri. On Windows that round-trip resolves elsewhere, so the version listing came back empty, zombies looked like bootstraps, and test_branch_ops_reject_zombie_branch failed on windows-build. resolve_branch_for_commit returns (uri, path) so the commit write and the branch_has_committed_versions check share one basis. The shared listing logic is extracted into list_versions_under, which takes a Path directly. Co-authored-by: Cursor <[email protected]>
On Windows, Path::from(format!(branch_location.path, ...)) diverges from find_branch().path.join(VERSIONS_DIR), so zombie detection missed the staged manifest and create_table_version accepted the commit. Stage with find_branch().path.join(VERSIONS_DIR). 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.
This PR picks up on the work in #7403 by @dantasse.
create_branchon managed tables callscreate_table_versionbefore_refs/branches/<branch>.jsonexists, andresolve_branch_locationrequires that ref. Bootstrap commit fails.create_table_versionnow goes throughresolve_branch_for_commitinstead 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 becausecreate_table_versionlooked for_refs/branches/exp.jsonbefore phase 2 wrote it.Testing
test_create_branch_on_managed_dataset_succeeds.test_branch_ops_reject_zombie_branch.