Repository navigation
Fix recreating a deleted cluster when the library-status lookup responds first - #7647
Open
pcbeingused333 wants to merge 2 commits into
Open
pcbeingused333 wants to merge 2 commits into
pcbeingused333 wants to merge 2 commits into
Conversation
DoRead ran the cluster and library-status lookups together and returned the first error. library-status reports a deleted cluster as INVALID_PARAMETER_VALUE, which the planner does not treat as missing, so plan and deploy aborted whenever that lookup finished first. Return the cluster error whenever the cluster read fails, and return a library error only after the cluster itself was read. Fixes databricks#7565
Contributor
|
Thanks for the contribution! This pull request was opened from a fork. If you're a member of the Databricks organization, please request access to the If you're an external contributor, no action is needed; a maintainer will review your pull request. |
Contributor
|
An authorized user can trigger integration tests manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
This branch has not been deployed
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.
Fixes #7565
Changes
bundle planandbundle deployrecreate a cluster that was deleted outside the bundle even when the libraries status lookup responds before the cluster lookup.Why
ResourceCluster.DoReadreads the cluster and its libraries together and used to return whichever error finished first. The libraries API reports a missing cluster as400 INVALID_PARAMETER_VALUE. The planner only treatsapierr.IsMissingas gone, and that code is not missing: the SDK remaps it only forGET /clusters/get. Planning aborted whenever the libraries lookup won the race. A failed cluster read, including not-found, now decides the outcome. A library error is still returned when the cluster itself was read, so a real library failure on a live cluster is unchanged.Tests
TestClusterDoReadDeletedClusterIgnoresLibraryStatusOrderforces each lookup to finish first. On main, the libraries-first case returnsINVALID_PARAMETER_VALUEand is not a missing-resource error. With this change both orders return the cluster not-found error.TestClusterDoReadLibraryErrorSurfacesWhenClusterExistsstill returns a library-status error for a live cluster, andTestClusterDoReadReturnsInstalledLibrariesstill keeps installed libraries and skips libraries installed for all clusters.This change was prepared with the help of an AI coding assistant.