acceptance: pin the stale-plan hole in deployment history recording - #6221
Draft
shreyas-goenka wants to merge 1 commit into
Draft
acceptance: pin the stale-plan hole in deployment history recording#6221shreyas-goenka wants to merge 1 commit into
shreyas-goenka wants to merge 1 commit into
Conversation
shreyas-goenka
force-pushed
the
isaac/dms-plan-staleness
branch
from
August 11, 2026 09:56
8ded923 to
35ba48c
Compare
Collaborator
Integration test reportCommit: 5b5f042
8 interesting tests: 4 RECOVERED, 4 SKIP
Top 32 slowest tests (at least 2 minutes):
|
shreyas-goenka
force-pushed
the
isaac/dms-plan-staleness
branch
3 times, most recently
from
August 11, 2026 12:14
607dd83 to
bf1af90
Compare
A plan computed before any deployment exists carries no lineage and no serial, so ValidatePlanAgainstState skips its check entirely. If a deployment is created between that plan and its apply, the plan is applied anyway and records a second CREATE for a resource that already exists. The test captures today's behaviour rather than the wanted one, so Badness describes what is wrong with it and the fix it is waiting for: take the lineage from the DMS deployment ID and the serial from the version the plan was computed against, and reject a plan that claims no deployment when one exists. Co-authored-by: Isaac
shreyas-goenka
force-pushed
the
isaac/dms-plan-staleness
branch
from
August 11, 2026 13:05
bf1af90 to
5b5f042
Compare
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.
Why
Stacked on #6094 (base
isaac/pr6052-fixes).ValidatePlanAgainstStateskips its lineage/serial check when the plan carries nolineage, which is the case for a plan computed before any deployment exists:
That is fine as a first-deploy allowance, but it also means the plan is applied when a
deployment has appeared in the meantime. The plan asserted "nothing is deployed" and
nothing re-checks that assertion, so a
createis replayed against a deployment thatalready has the resource, and a second
CREATEoperation is recorded for it.What
Adds
acceptance/bundle/dms/stale-plan-not-detected, which captures today's behaviourrather than the wanted one:
bundle plan -o jsonbefore anything is deployed — the plan records"lineage": null, "serial": nulland acreatebundle deploy— creates the deployment and its first versionbundle deploy --plan <the earlier plan>— accepted, and records a secondCREATEBadnessintest.tomldescribes what is wrong with the test and the fix it iswaiting for, so the golden is not mistaken for intended behaviour. A
TODO(DMS)onValidatePlanAgainstStatepoints at the test.The fix this is waiting for
Take the lineage from the DMS deployment ID and the serial from the version the plan
was computed against, and treat both being empty as a positive claim that no
deployment existed — so a deployment found at the state path at apply time is an
error. The deployment-ID half can land on its own; the serial half also needs the WAL
recovery check in
dstatereworked, since it currently requires the serial to advanceby exactly one per local commit.
Tests
go test ./acceptance -run TestAccept/bundle/dms— 33 pass.This pull request and its description were written by Isaac.