Conversation
Collaborator
Integration test reportCommit: 0e8d953
Top 6 slowest tests (at least 2 minutes):
|
…t unchanged
A reference to a resource being recreated cannot be resolved at plan time (a recreate does
not preserve the id), so the planner diffs the dependent field against the literal "${...}"
placeholder and inflates the dependent's action -- a recreate for an immutable/id field, an
update for a mutable one -- even when the referenced value does not actually change.
At apply, references are resolved in dependency order before the resource is deployed. Re-check
the plan's own changes there and drop any that were a phantom of an unresolved reference: a
local edit (New != Old, where New was the placeholder) whose field now resolves back to Old.
Recompute the action over what remains and downgrade it -- never upgrade. If nothing remains,
the resource is skipped instead of recreated/updated.
Working from the plan's own changes rather than re-diffing from scratch keeps changes a struct
diff would not surface (a cluster's libraries) and remote-only drift (New == Old) intact; child
resources (permissions, grants) are excluded because their diff is specialized.
The recreate-reference acceptance tests now show the direct engine issuing no spurious request.
Co-authored-by: Isaac <no-reply@databricks.com>
denik
force-pushed
the
denik/downgrade-action-impl
branch
from
October 2, 2026 11:31
f21d998 to
0e8d953
Compare
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.
Stacked on #6895 (the demonstration tests). Implements the apply-time downgrade.
The bug
When a resource is recreated, the direct engine cannot resolve a reference to its output fields at plan time (a recreate does not preserve the id), so the dependent field diffs against the literal
${...}placeholder and the dependent gets a spurious recreate (immutable/id field) or update (mutable field) — even though the referenced value is unchanged.The fix
References are already resolved at apply time, in dependency order, before each resource is deployed. This re-checks the plan's own
entry.Changesthere and drops any that were a phantom of an unresolved reference — a local edit (New != Old, whereNewwas the placeholder) whose field now resolves back toOld— then recomputes the action and downgrades it (never upgrades). If nothing remains, the resource is skipped.Working from the plan's own changes rather than re-diffing from scratch keeps the downgrade safe: a genuine edit still differs from
Oldand is kept; remote-only drift (New == Old) is never a phantom; changes a struct diff would not surface (a cluster's libraries) are untouched; child resources (permissions, grants) are excluded.Effect
The direct engine now issues no spurious request: the recreate test's catalog recreate, and the update tests'
PATCH, are downgraded to no-ops. (For context — the tests run direct-only now — terraform could not cancel a replace, so the direct engine ends up strictly more capable on the recreate case.)Limitation
Apply-time only, so
bundle planstill previews the spurious action; the deploy downgrades it. The goldens reflect that (plan unchanged; requests show the downgrade).This pull request and its description were written by Isaac.