engine/direct: recover from a failed Create during Recreate#5173
Open
janniklasrose wants to merge 5 commits intomainfrom
Open
engine/direct: recover from a failed Create during Recreate#5173janniklasrose wants to merge 5 commits intomainfrom
janniklasrose wants to merge 5 commits intomainfrom
Conversation
Co-authored-by: Isaac
Approval status: pending
|
d9ae6b7 to
b94cf0e
Compare
janniklasrose
commented
May 4, 2026
|
|
||
| Exit code: 1 | ||
|
|
||
| === Subsequent plan recovers: my_endpoint state was dropped, replan as Create |
Contributor
Author
There was a problem hiding this comment.
Compare with 9cb1077 where this was a failure
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.
Changes
bundle/direct/apply.go:Recreatenow drops the deployment state entry (db.DeleteState) betweenDoDeleteand the follow-upCreate, instead ofdb.SaveState(key, "", nil, nil).bundle/direct/bundle_plan.go: Treat an existing state entry whose__id__is empty as missing, so the next plan re-plansCreateinstead of erroring withinvalid state: empty id. This covers state files written by pre-fix CLIs.acceptance/bundle/resources/vector_search_endpoints/recreate/create-fails/: New test that triggers the failure path end-to-end by renamingmy_endpointonto a sibling endpoint's name and switching itsendpoint_type. The first Recreate'sCreate409s on the conflict; the nextbundle planrecovers cleanly.Why
A direct-engine
Recreatewas aDoDelete→SaveState(key, "", nil, nil)→Createsequence. If the follow-upCreatefailed for any reason (in our reproducer: a name collision against another bundle resource),Finalizepersisted a state row with__id__ == "". Every subsequentbundle planthen refused to proceed (invalid state: empty id) andbundle destroycouldn't recover either, leaving the bundle in a broken state until the user hand-editedresources.json.Dropping the state entry up front means a failed
Createsimply looks like "no state for this resource" on the next plan, which is the natural recovery path. The planner-side tolerance handles state files already written by older CLIs.Tests
bundle/resources/vector_search_endpoints/recreate/create-failsexercises the full path: initial deploy, Recreate triggered byendpoint_typechange,Create409 from a name collision withblocker_endpoint, thenbundle planshowingcreate my_endpointandbundle destroycleaning up.go test ./bundle/...passes../task lintpasses../task testhad unrelated local failures (Pythondatabricks-bundlesmodule not installed in the fresh worktree's venv, surfacing in pydabs/invariant tests); CI should not hit that.PR description drafted with Claude Code.