Repository navigation
direct: retry delete on transient server errors #7708
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| * Retry transient server errors when deleting resources in the direct deployment engine. ([#7708](https://github.com/databricks/cli/pull/7708)) |
12 changes: 12 additions & 0 deletions
12
acceptance/bundle/resources/postgres_projects/delete_transient_500/databricks.yml
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,12 @@ | ||
| bundle: | ||
| name: test-bundle | ||
|
|
||
| sync: | ||
| paths: [] | ||
|
|
||
| resources: | ||
| postgres_projects: | ||
| my_project: | ||
| project_id: test-pg-proj | ||
| display_name: "Test Postgres Project" | ||
| pg_version: 16 |
3 changes: 3 additions & 0 deletions
3
acceptance/bundle/resources/postgres_projects/delete_transient_500/out.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,3 @@ | ||
| Cloud = false | ||
| EnvMatrix.DMS = ["", "true"] | ||
| EnvMatrix.READPLAN = [] |
23 changes: 23 additions & 0 deletions
23
acceptance/bundle/resources/postgres_projects/delete_transient_500/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,23 @@ | ||
|
|
||
| >>> [CLI] bundle deploy | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... | ||
| Created postgres_projects.my_project | ||
| Files: 0 uploaded, 0 deleted | ||
| Resources: 1 created, 0 changed, 0 deleted, 0 unchanged | ||
|
|
||
| >>> [CLI] bundle destroy --auto-approve | ||
| The following resources will be deleted: | ||
| delete resources.postgres_projects.my_project | ||
|
|
||
| This action will result in the deletion of the following Lakebase projects along with | ||
| all their branches, databases, and endpoints. All data stored in them will be permanently lost: | ||
| delete resources.postgres_projects.my_project | ||
|
|
||
| All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default | ||
|
|
||
| Warn: destroying resources.postgres_projects.my_project: retrying after 500 Internal Server Error from DELETE /api/2.0/postgres/projects/test-pg-proj | ||
| Destroy: 1 deleted | ||
|
|
||
| >>> print_requests.py --method DELETE --summary //postgres | ||
| DELETE /api/2.0/postgres/projects/test-pg-proj | ||
| DELETE /api/2.0/postgres/projects/test-pg-proj |
10 changes: 10 additions & 0 deletions
10
acceptance/bundle/resources/postgres_projects/delete_transient_500/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,10 @@ | ||
| trace $CLI bundle deploy | ||
|
|
||
| # The delete lands but the response is a transient 500. The retry gets a NotFound, which counts as | ||
| # deleted, so the destroy succeeds. | ||
| fault.py --after-handler "DELETE /api/2.0/postgres/projects/*" 500 0 1 INTERNAL_ERROR | ||
|
|
||
| trace $CLI bundle destroy --auto-approve | ||
|
|
||
| # Two delete requests: the one that landed and the retry. | ||
| trace print_requests.py --method DELETE --summary //postgres |
6 changes: 6 additions & 0 deletions
6
acceptance/bundle/resources/postgres_projects/delete_transient_500/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,6 @@ | ||
| Cloud = false | ||
| RecordRequests = true | ||
| EnvMatrix.READPLAN = [] | ||
| Env.DATABRICKS_BUNDLE_ENGINE = "direct" | ||
| Env.DATABRICKS_BUNDLE_RETRY_INTERVAL_MS = "100" | ||
| SuppressLines.warn_retry = "" |
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.
Uh oh!
There was an error while loading. Please reload this page.