Repository navigation
direct: use the Lakebase catalog a failed create request created - #7801
Merged
Merged
Conversation
database_catalogs and postgres_catalogs creates now get the same recovery as postgres branches, projects and roles: on a transient error, look the catalog up, use it if this deployment created it, and repeat the create while it is missing. Co-authored-by: Isaac <no-reply@databricks.com>
cloud: TestAccept/bundle/resources/database_catalogs TestAccept/bundle/resources/postgres_catalogs TestAccept/bundle/resources/synced_database_tables/basic TestAccept/bundle/resources/postgres_synced_tables/basic Co-authored-by: Isaac <no-reply@databricks.com>
Contributor
|
Commit: Regression test reportSelected 2 changed tests (limit=20, 0 not selected) 16 tests: regression=4 unreleased=0 coverage=12 failing=0
TestAccept/bundle/resources/database_catalogs/create_504/DMS=: branch ✅ | main (ab7c938) ❌ | latest (v1.27.0) ❌main (ab7c938): latest (v1.27.0): same output as main (ab7c938) TestAccept/bundle/resources/database_catalogs/create_504/DMS=true: branch ✅ | main (ab7c938) ❌ | latest (v1.27.0) ❌main (ab7c938): latest (v1.27.0): same output as main (ab7c938) TestAccept/bundle/resources/postgres_catalogs/create_transient_500/DMS=: branch ✅ | main (ab7c938) ❌ | latest (v1.27.0) ❌main (ab7c938): latest (v1.27.0): same output as main (ab7c938) TestAccept/bundle/resources/postgres_catalogs/create_transient_500/DMS=true: branch ✅ | main (ab7c938) ❌ | latest (v1.27.0) ❌main (ab7c938): latest (v1.27.0): same output as main (ab7c938) |
Collaborator
✅ Integration test reportCommit: a2d3ad0
Top 13 slowest tests (at least 2 minutes):
|
andrewnester
approved these changes
Nov 19, 2026
deco-sdk-tagging Bot
added a commit
that referenced
this pull request
Nov 24, 2026
## Release v1.28.0 ### CLI * Retry transient errors in `fs` commands: `fs cp` to a UC Volume from another Volume or DBFS (files up to 8 MiB) on HTTP 503, DBFS uploads when the upload stream is lost, and stat, read and list on UC Volumes on HTTP 500. ([#7607](#7607), [#7763](#7763), [#7839](#7839)) * `databricks auth profiles --skip-validate` now omits the `Valid` column instead of reporting `NO` for every profile. ([#7638](#7638)) * Fix Ctrl-C taking about 10 seconds to stop `databricks aitools install`, `update` or `uninstall` while it runs a coding agent's CLI, and retry reading an agent's config on Windows while the agent rewrites it. ([#7832](#7832), [#7870](#7870)) * Automatic installation of Databricks AI tools no longer asks in containers or installs for the first time without a terminal, no longer runs as root in another user's home, keeps newer skills you installed, no longer hints to install what it is about to install, and on Linux and macOS stops the calling script on Ctrl-C. ([#7828](#7828), [#7834](#7834), [#7874](#7874), [#7888](#7888), [#7890](#7890), [#7901](#7901)) * Wait before retrying a failed automatic install of Databricks AI tools, starting at 5 minutes and doubling after each failure, so a skills source or coding agent CLI that stays broken no longer slows down each of the next commands. ([#7900](#7900)) * `databricks aitools install` now cancels the agent picker on Esc. ([#7721](#7721)) * `databricks aitools uninstall --skills` now fails when its value names no skill instead of removing every skill, and `aitools update` and `uninstall` no longer prompt when a coding agent runs them; with skills in both scopes they fail and ask for `--scope`. ([#7873](#7873)) * `databricks aitools install --skills-only` and `databricks aitools update` no longer mix skill files with the Databricks plugin: install skips agents that already have the plugin, and update no longer replaces skill files from a `--skills-only` install made with this release or later while the agent's CLI was on PATH. To keep skill files from an earlier `--skills-only` install, run `databricks aitools install --skills-only` again with the agent's CLI on PATH. ([#7831](#7831), [#7903](#7903)) * `apps init` no longer suggests installing skills to Codex and Copilot users who installed the Databricks plugin with `databricks aitools install`. ([#7830](#7830)) * Fix `databricks auth login` failing with `data passed to Set was too big` on macOS and Windows for OAuth tokens too large for one keyring item. ([#7845](#7845)) * Fix the token storage mode (`auth_storage`) being read from the file named by `DATABRICKS_CONFIG_FILE` instead of the config file the profile was loaded from. ([#7733](#7733)) * `databricks auth login` no longer waits for the browser that the default opener starts to close before it continues. ([#7551](#7551)) * Allow `databricks auth docker configure` when several profiles match one workspace; the chosen profile is recorded for the registry and shown by `databricks auth docker host`. ([#7383](#7383)) * Show the HTTP status, error code and endpoint when an API error has no message, instead of a bare `Error: `, and the HTTP status and path for Files API errors that used to show an empty `databricks-api error:`. ([#7800](#7800), [#7839](#7839)) * AI agents can now submit feedback without confirmation; `--yes`/`-y` is deprecated, and agents passing `--yes=false` now get an error. ([#7795](#7795)) * Log `/.well-known/databricks-config` fetch failures with a transient HTTP status (408, 429, or 5xx other than 501) at debug level instead of as a warning, like timeouts. ([#7912](#7912)) * Fix interactive list output sometimes dropping or reordering a page of rows. ([#7804](#7804), [#7914](#7914)) * Allow `databricks sandbox forward` to forward remote ports below 10000. The sandbox refuses a few reserved platform ports with an error that names the port. ([#7861](#7861)) * Breaking: `databricks sandbox ssh` now uses local SSH keys and works with sandboxes created through the SDK or API; it no longer accepts `--port` and needs Python 3 and `openssh-server` in the sandbox. Add `databricks sandbox ssh-setup` to configure native SSH and SCP. ([#7588](#7588), [#7589](#7589), [#7590](#7590)) * `databricks ssh connect` to serverless CPU compute now defaults to environment version 5, so the first connection after upgrading starts a new server; pass `--environment-version 4` to keep the old one. ([#7847](#7847)) * `databricks ssh connect` now downloads the SSH server binaries from PyPI when GitHub is unreachable, using `PIP_INDEX_URL` or `index-url` from the per-user pip config over HTTPS only, and checks SHA-256 digests. ([#7852](#7852)) ### AI Runtime * Breaking: `compute.pool_id` is no longer accepted in AIR workload YAML; use `compute.accelerator_pool_id`. ([#7698](#7698)) * `databricks air convert-to-dabs` handles an existing output directory better: it gives the right guidance when the directory already holds the workload's bundle, `--force` no longer replaces a different bundle or an alternate root file, re-converting removes stale sidecars, and git-pinned code outside the bundle gets an `--output-dir` suggestion. ([#7835](#7835), [#7853](#7853), [#7857](#7857), [#7866](#7866)) * `air list` and `air get` now find the AI Runtime task anywhere in a multi-task job; a job with several such tasks lists one row per task (so `run_id` is no longer unique in `air list -o json`), and both report `task_key` (`air get --task-key` selects one). `air list --all-status` now orders runs by submission time instead of by their latest attempt's start. ([#7632](#7632)) * Update fallback messages for pending AI Runtime runs when AIR does not report a status reason. ([#7899](#7899)) * `air run -o json` now reports config-validation errors as a JSON error envelope, with `UNAUTHENTICATED`, `INVALID_ARGS` or the new `PERMISSION_DENIED` code. ([#7864](#7864)) ### Bundles * Bundle commands no longer hang after a request timeout on a dead HTTP/2 connection. ([#7723](#7723)) * Fix a panic when the local Terraform state is removed after it is pulled and before it is migrated to the direct engine, for example by a concurrent `bundle deploy`. ([#7778](#7778)) * The direct deployment engine now uses a Lakebase or postgres catalog that a failed create request still created, instead of failing the deploy. ([#7801](#7801)) * `bundle deploy` and `bundle run` for apps now succeed when the app's compute is already active or starting, and deploy the app when the deployment triggered by start failed. ([#7709](#7709), [#7780](#7780)) * Add `thumbnail_path` to the `apps` resource, so `bundle deploy` sets, updates and deletes the thumbnail shown for the app in the Apps UI. ([#7728](#7728)) * Fix bundle commands failing on a notebook or file path with a colon in its first segment, such as the default workspace notebook name `New Notebook 2026-10-28 12:17:43.ipynb`. ([#7851](#7851)) * `bundle run` and `pipelines run` now retry transient errors from the pipeline events and update status reads while waiting for an update. ([#7800](#7800)) ### Dependency Updates * Bump dependencies with known vulnerabilities. ([#7904](#7904)) * Update the Go SDK to [v0.203.0](https://github.com/databricks/databricks-sdk-go/releases/tag/v0.203.0). ([#7869](#7869), [#7906](#7906)) * Update `github.com/databricks/sdk-go/files` to [v0.9.0](https://github.com/databricks/sdk-go/blob/files/v0.9.0/files/CHANGELOG.md). ([#7889](#7889))
apeforest
pushed a commit
to apeforest/cli
that referenced
this pull request
Nov 25, 2026
…abricks#7910) ## Changes A create request that times out or gets a 5xx may still have been applied by the backend. Repeating it then fails with "already exists", and every later deploy fails the same way. Seven recent PRs taught one resource at a time to recover from this ([databricks#7602](databricks#7602), [databricks#7747](databricks#7747), [databricks#7757](databricks#7757), [databricks#7767](databricks#7767), [databricks#7782](databricks#7782), [databricks#7801](databricks#7801), plus [databricks#7599](databricks#7599) for vector search endpoints). They used three implementations. This PR moves all of them onto one helper, adds the helper to every resource that can support it, and adds a test that fails when a resource has neither recovery nor a documented opt-out. ### Design `recoverCreate` in `bundle/direct/dresources/create_recovery.go` is now the only implementation: 1. It returns the create error unchanged unless the error leaves the outcome unknown: a transient error, 499 CANCELLED, or an HTTP/2 stream reset. 2. It looks the resource up by the name the bundle chose. 3. If the resource is found, it uses it only if its create time is no more than a minute before the first request. A resource with no create time, or an older one, fails the deploy with the original error. For Unity Catalog resources it also requires `created_by` to be the deploying principal (`createdByCaller`). That way a resource that belongs to someone else is never taken over. 4. If the resource is missing, it pauses and repeats the request, up to `retry.MaxRetries` times. A repeat that fails with "already exists" means an earlier request landed in the meantime, so the next lookup finds it. Each resource says how its API reports a taken name: `isAlreadyExists` (error codes ALREADY_EXISTS, RESOURCE_ALREADY_EXISTS, CATALOG_ALREADY_EXISTS, SCHEMA_ALREADY_EXISTS; the Unity Catalog codes were checked on AWS), or `isPostgresAlreadyExists` for the Lakebase projects, branches, roles and catalogs that already used it, which also matches the 400 that projects return. `createRecovery[T, R]` has two optional extension points that the Lakebase resources need. `use` turns a found resource into DoCreate's result, for example by waiting for a branch to become READY. `create` returns a `finish` step that waits for the create operation, and errors from that step are not treated as a failed create request. `useFound` and `repeatCreate` fill both in for the common case. Resources whose create is idempotent keep the existing `retrySafe(err)` route. There, `DeploymentUnit.Create` repeats the request. Its retry rule is now `dresources.IsRetrySafe`, so the test runs DoCreate with the same rule the deploy uses. `IsRetrySafe` repeats on the same uncertain errors as `recoverCreate`, so 499 and stream resets are now also repeated for permissions, grants and Lakebase creates with `replace_existing`. `TestCreateRecoveryCoverage` (`create_recovery_coverage_test.go`) covers every entry in `SupportedResources`: - It runs DoCreate once against the test server to find the create request. That is the first mutating request; if DoCreate sends it more than once, as dashboards do after creating their folder, the test uses the last send. - It then fails that request with a 504 through an HTTP transport, in two variants: after the server applied it, and before. - It runs DoCreate the way the deploy does, including the `retrySafe` repeat. It also checks that the failed request is the create request from the first run (method and path, with ids masked). - Every resource must succeed in both variants. In the applied variant, a resource that does not use `retrySafe` must not send the create request again, because for a backend-assigned id that would make a duplicate. - A resource that cannot recover goes in `createRecoveryOptOut` with the reason. A listed resource must fail with the injected 504. If it starts recovering, or fails for another reason, the test fails, so the list cannot go stale. `prepareTestState` is moved out of `testCRUD` unchanged, so both tests build the same fixtures. ### Per-resource table | Resource | Recovery | Since | |---|---|---| | features, dashboards, model_serving_endpoints, model_services, mcp_services, model_provider_services, database_catalogs | `recoverCreate` (lookup by name or path) | earlier PRs | | postgres_projects, postgres_branches, postgres_roles, postgres_catalogs | `recoverCreate`, previously `recoverPostgresCreate`; branches and roles with `replace_existing` use `retrySafe` | earlier PRs, moved here | | vector_search_endpoints | `recoverCreate`, previously its own retry loop | [databricks#7599](databricks#7599), moved here | | postgres_endpoints, postgres_databases | `recoverCreate`; with `replace_existing`, `retrySafe` | this PR | | postgres_synced_tables | `recoverCreate` | this PR | | catalogs (the create request; not the follow-up isolation_mode update), schemas, volumes, external_locations, registered_models, secrets | `recoverCreate` (Unity Catalog full name, `created_at` / `create_time`) | this PR | | postgres_snapshot_schedules, secret_scopes.permissions | `retrySafe` (setting the desired value again is safe) | this PR | | *.permissions, *.grants | `retrySafe` | earlier | | jobs, pipelines, clusters, sql_warehouses, instance_pools, alerts, genie_spaces | opt-out: the backend assigns the id, and the create request takes no idempotency token | | | feature_specs, secret_scopes, quality_monitors, data_quality_monitors, vector_search_indexes, synced_database_tables | opt-out: the read response has no create time, so a found resource could predate the deploy | | | internal_immutable_snapshots | opt-out: immutable upload; not known whether a second upload to the same path is accepted | | | job_runs, materialization_sets | opt-out, candidate: repeat with the same idempotency token / request_id (DoCreate mints a new one per request today) | | | cluster_policies, apps, database_instances, experiments, models, postgres_data_apis | opt-out, candidate: unique name and a create time exist, but each needs its own work (lookup by name for a backend id, the app DELETING path, test server support, a Data API's spec that comes from a status that can still be empty) | | The reasons are spelled out in `createRecoveryOptOut`. ### Behavior changes for resources that already recovered - Lakebase projects, branches, roles and catalogs now also recover from 499 CANCELLED and HTTP/2 stream resets, as the other resources already did. The lookup is also retried on those errors. - Lakebase resources now also treat 409 RESOURCE_ALREADY_EXISTS and 400 CATALOG_ALREADY_EXISTS on a repeated request as "already exists". The other resources match exactly what they matched before. A repeated request that fails this way is always followed by another lookup and the create-time check. - A Lakebase resource found without a create time now fails with "exists but has no create time, so it is not known to be created by this deployment" instead of "was not created by this deployment". - Vector search endpoints now look the endpoint up before repeating the request, instead of repeating it and handling ALREADY_EXISTS. The outcome is the same with one request fewer. The "was created by an earlier attempt" warning becomes the shared Info log. - The lookup-failure warning now names the resource type, e.g. "checking whether project projects/x was created". That is the only change in the four Lakebase goldens. ### Known limits - A recovered Lakebase synced table or database is used as soon as the lookup finds it. The success path waits for the create operation, but recovery has no operation to wait on. Recovered Lakebase catalogs and roles already work this way. Endpoints still wait for reconciliation; if that wait ends early, the endpoint is kept with a warning, as branches and projects are. - Each covered DoCreate wires its own `recoverCreate` call. Moving recovery into the framework, with an optional adapter method for the lookup, would cut the per-resource code. It would also change the adapter interface, so I left it for a separate change. The coverage test already catches a resource that forgets the call. ## Why The same class of failure kept coming back one resource at a time. Recent main failures this PR fixes: | Error | Verbatim | |---|---| | [error/3328](http://go/cli/dashboard/error/3328?main=1&pr=1&end=2026-11-24T10:00:00Z&last=14d) | `Error: cannot create resources.postgres_synced_tables.my_table: (504 DEADLINE_EXCEEDED)` | | [error/537](http://go/cli/dashboard/error/537?main=1&pr=1&end=2026-11-24T10:00:00Z&last=14d) | `Error: cannot create resources.postgres_synced_tables.my_table: The request could not be processed. Please try again later and contact Databricks if the problem persists. [TraceId: [TRACE_ID]] (500 INTERNAL_ERROR)` | | [error/3801](http://go/cli/dashboard/error/3801?main=1&pr=1&end=2026-11-24T10:00:00Z&last=14d) | `Error: cannot create resources.schemas.schema1: Post "[DATABRICKS_URL]/api/2.1/unity-catalog/schemas": unexpected EOF (500 UNKNOWN)` | Dashboard: - [error/3328](http://go/cli/dashboard/error/3328?main=1&pr=1&end=2026-11-24T10:00:00Z&last=14d): [TestAccept/bundle/resources/postgres_synced_tables/basic/DMS=](http://go/cli/dashboard/test/acceptance.TestAccept/bundle/resources/postgres_synced_tables/basic/DMS=?main=1&pr=1&end=2026-11-24T10:00:00Z&last=14d), [TestAccept/bundle/resources/postgres_synced_tables/basic/DMS=true](http://go/cli/dashboard/test/acceptance.TestAccept/bundle/resources/postgres_synced_tables/basic/DMS=true?main=1&pr=1&end=2026-11-24T10:00:00Z&last=14d) - [error/537](http://go/cli/dashboard/error/537?main=1&pr=1&end=2026-11-24T10:00:00Z&last=14d): [TestAccept/bundle/resources/postgres_synced_tables/recreate/DMS=](http://go/cli/dashboard/test/acceptance.TestAccept/bundle/resources/postgres_synced_tables/recreate/DMS=?main=1&pr=1&end=2026-11-24T10:00:00Z&last=14d), [TestAccept/bundle/resources/postgres_synced_tables/recreate/DMS=true](http://go/cli/dashboard/test/acceptance.TestAccept/bundle/resources/postgres_synced_tables/recreate/DMS=true?main=1&pr=1&end=2026-11-24T10:00:00Z&last=14d) - [error/3801](http://go/cli/dashboard/error/3801?main=1&pr=1&end=2026-11-24T10:00:00Z&last=14d): [TestAccept/bundle/resources/grants/volume_change_name/DMS=](http://go/cli/dashboard/test/acceptance.TestAccept/bundle/resources/grants/volume_change_name/DMS=?main=1&pr=1&end=2026-11-24T10:00:00Z&last=14d) ## Tests - `TestCreateRecoveryCoverage` covers all 72 registry keys. To check that it catches gaps, I disabled schema recovery and then removed the jobs opt-out; the test failed for each with the "call recoverCreate ... or add it to createRecoveryOptOut" message. - `TestSchemaCreateRecoveryRejectsSchemaOfAnotherUser` and `TestSchemaCreateRecoveryLooksAgainAfterSchemaAlreadyExists` cover the creator check and a repeat that loses to the first request. - The existing unit tests for features, dashboards, database catalogs and the Lakebase resources pass unchanged. I added `TestCreateRecoveryAllowsClockSkew` to replace the vector search `createdSince` test, which tested a function this PR removes. - `go test ./acceptance -run TestAccept/bundle` passes. Golden changes: the Lakebase warning wording, and the vector search create-504 request sequence. Decisions: - I kept experiments and models as candidates rather than adding them here. libs/testserver would need `get-by-name` and creation timestamps, and those timestamps would show up in many unrelated goldens. - New DoCreate code uses the `create := func(ctx)` pattern of the resources that already recovered, so that the create call can be handed to `recoverCreate` and repeated. - I left jobs and pipelines as opt-outs. Without an idempotency token, a repeated create cannot tell its own resource from a duplicate. This pull request and its description were written by Isaac. --------- Co-authored-by: Isaac <no-reply@databricks.com>
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
Lakebase catalog creates now recover from transient errors the way postgres branches, projects and roles already do (#7602, #7747, #7767). Until now,
database_catalogsandpostgres_catalogsfailed the deploy on any create error. If the catalog had actually been created, the next deploy also failed, with "already exists".recoverPostgresCreatelooks the catalog up. It uses the catalog if itscreate_timeshows this deployment created it, and repeats the create while the catalog is missing. This is the same code path roles use.recoverCreate, as features, serving endpoints and AI Gateway services do (#7757, #7782). The Database API returns no create time, so the time check usescreated_atof the Unity Catalog catalog the database catalog registers. I checked on AWS that it is there, withcatalog_type: MANAGED_ONLINE_CATALOG. If the database catalog exists but its UC catalog can't be found, the deploy fails with "has no create time" rather than repeating the create.400 CATALOG_ALREADY_EXISTS("Catalog '...' already exists"; checked on AWS).isPostgresAlreadyExistsalready matches that response.isAlreadyExistsnow matches it as well, so a repeated database catalog create that lands after an earlier one triggers another lookup.Testserver, to match the cloud:
created_at, and the delete removes it.404 CATALOG_DOES_NOT_EXISTinstead of a plain-text 404. Without the error code the SDK doesn't report it as missing.400 CATALOG_ALREADY_EXISTS, not 409 or silently overwriting.Judgment calls:
retry.IsTransient, like its postgres siblings, not on the widerisUncertainCreateError(499, stream resets). Neither of those has been seen on Lakebase creates.Why
These create errors fail cloud runs on main. The two dashboard errors this PR fixes:
Dashboard
Error: cannot create resources.database_catalogs.my_catalog: (504 DEADLINE_EXCEEDED)(Azure, 4 failures since 2026-10-26)Error: cannot create resources.postgres_catalogs.my_catalog: The request could not be processed. Please try again later and contact Databricks if the problem persists. [TraceId: [TRACE_ID]] (500 INTERNAL_ERROR)(AWS, GCP)Tests: TestAccept/bundle/resources/synced_database_tables/basic/DMS=, TestAccept/bundle/resources/synced_database_tables/basic/DMS=true, TestAccept/bundle/resources/postgres_synced_tables/basic/DMS=true
Tests
database_catalogs/create_504covers a catalog created despite a 504, a catalog that was not created, a catalog that only shows up after the repeat hits "already exists", and an unreadable catalog.postgres_catalogs/create_transient_500covers created, not created (504) and unreadable.testme-aws: UCcreated_aton a database catalog, and the duplicate-create error from both APIs.This pull request and its description were written by Isaac.