-
Notifications
You must be signed in to change notification settings - Fork 165
engine/direct: recover from a failed Create during Recreate #5173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
janniklasrose
wants to merge
5
commits into
main
Choose a base branch
from
janniklasrose/recreate-empty-id
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9cb1077
Add acceptance test with Badness for create failures in recreate flow
janniklasrose 9ed7323
Fix bug
janniklasrose 73a574d
Update acceptance tests with passing result
janniklasrose 258c4de
Mark blocker_endpoint as STORAGE_OPTIMIZED to avoid race condition
janniklasrose b94cf0e
changelog: Recreate empty-id state recovery
janniklasrose File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
14 changes: 14 additions & 0 deletions
14
...ptance/bundle/resources/vector_search_endpoints/recreate/create-fails/databricks.yml.tmpl
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| bundle: | ||
| name: recreate-create-fails-$UNIQUE_NAME | ||
|
|
||
| sync: | ||
| paths: [] | ||
|
|
||
| resources: | ||
| vector_search_endpoints: | ||
| my_endpoint: | ||
| name: vs-endpoint-a-$UNIQUE_NAME | ||
| endpoint_type: STANDARD | ||
| blocker_endpoint: | ||
| name: vs-endpoint-b-$UNIQUE_NAME | ||
| endpoint_type: STORAGE_OPTIMIZED |
4 changes: 4 additions & 0 deletions
4
acceptance/bundle/resources/vector_search_endpoints/recreate/create-fails/out.test.toml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
acceptance/bundle/resources/vector_search_endpoints/recreate/create-fails/output.txt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
|
|
||
| === Initial deploy creates two endpoints with distinct names | ||
| >>> [CLI] bundle deploy | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/recreate-create-fails-[UNIQUE_NAME]/default/files... | ||
| Deploying resources... | ||
| Updating deployment state... | ||
| Deployment complete! | ||
|
|
||
| === Edit my_endpoint: rename onto blocker_endpoint's name and switch endpoint_type to trigger Recreate | ||
| >>> update_file.py databricks.yml vs-endpoint-a-[UNIQUE_NAME] vs-endpoint-b-[UNIQUE_NAME] | ||
|
|
||
| >>> update_file.py databricks.yml endpoint_type: STANDARD endpoint_type: STORAGE_OPTIMIZED | ||
|
|
||
| === Deploy: Recreate of my_endpoint runs Delete (ok) then Create (409, name taken by blocker) | ||
| >>> [CLI] bundle deploy --auto-approve | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/recreate-create-fails-[UNIQUE_NAME]/default/files... | ||
| Deploying resources... | ||
| Error: cannot recreate resources.vector_search_endpoints.my_endpoint: Vector search endpoint with name vs-endpoint-b-[UNIQUE_NAME] already exists (409 RESOURCE_ALREADY_EXISTS) | ||
|
|
||
| Endpoint: POST [DATABRICKS_URL]/api/2.0/vector-search/endpoints | ||
| HTTP Status: 409 Conflict | ||
| API error_code: RESOURCE_ALREADY_EXISTS | ||
| API message: Vector search endpoint with name vs-endpoint-b-[UNIQUE_NAME] already exists | ||
|
|
||
| Updating deployment state... | ||
|
|
||
| Exit code: 1 | ||
|
|
||
| === Subsequent plan recovers: my_endpoint state was dropped, replan as Create | ||
| >>> [CLI] bundle plan | ||
| create vector_search_endpoints.my_endpoint | ||
|
|
||
| Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged | ||
|
|
||
| >>> [CLI] bundle destroy --auto-approve | ||
| The following resources will be deleted: | ||
| delete resources.vector_search_endpoints.blocker_endpoint | ||
|
|
||
| All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/recreate-create-fails-[UNIQUE_NAME]/default | ||
|
|
||
| Deleting files... | ||
| Destroy complete! | ||
20 changes: 20 additions & 0 deletions
20
acceptance/bundle/resources/vector_search_endpoints/recreate/create-fails/script
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| envsubst < databricks.yml.tmpl > databricks.yml | ||
|
|
||
| cleanup() { | ||
| trace $CLI bundle destroy --auto-approve || true | ||
| rm -f out.requests.txt | ||
| } | ||
| trap cleanup EXIT | ||
|
|
||
| title "Initial deploy creates two endpoints with distinct names" | ||
| trace $CLI bundle deploy | ||
|
|
||
| title "Edit my_endpoint: rename onto blocker_endpoint's name and switch endpoint_type to trigger Recreate" | ||
| trace update_file.py databricks.yml "vs-endpoint-a-$UNIQUE_NAME" "vs-endpoint-b-$UNIQUE_NAME" | ||
| trace update_file.py databricks.yml " endpoint_type: STANDARD" " endpoint_type: STORAGE_OPTIMIZED" | ||
|
|
||
| title "Deploy: Recreate of my_endpoint runs Delete (ok) then Create (409, name taken by blocker)" | ||
| errcode trace $CLI bundle deploy --auto-approve | ||
|
|
||
| title "Subsequent plan recovers: my_endpoint state was dropped, replan as Create" | ||
| trace $CLI bundle plan |
1 change: 1 addition & 0 deletions
1
acceptance/bundle/resources/vector_search_endpoints/recreate/create-fails/test.toml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Cloud = false |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compare with 9cb1077 where this was a failure