Repository navigation
fix(cloud): durably retry observed destroy cleanup #15423
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
teamleaderleo
merged 20 commits into
manaflow-ai:main
from
teamleaderleo:fix/cloud-cleanup-outbox-followup
Sep 30, 2026
Merged
Changes from 17 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
ecaf069
test(cloud): cover the reads that find a Cloud machine gone
teamleaderleo fa6b69c
fix(cloud): finish the destroy work where a machine is first found gone
teamleaderleo c7da06f
fix(cloud): derive the observed status inside the shared destroy path
teamleaderleo 9b2facb
vm: say what a paused 404 row means for credentials
teamleaderleo 6a32750
test(cloud): reproduce lost destroy ledger retry
teamleaderleo 1e8f7b7
fix(cloud): retire missing provider compute durably
teamleaderleo 8023b39
fix(cloud): durably drain observed destroy cleanup
teamleaderleo dbddeef
fix(cloud): keep destroy cleanup queue fair and indexed
teamleaderleo 561cbb0
fix(vm): make observed cleanup retries index-safe
teamleaderleo e974728
test(cloud): reproduce account deletion cleanup loss
teamleaderleo b274a2f
fix(cloud): retain pending destroy cleanup on account deletion
teamleaderleo a6f3b0b
fix(cloud): transfer account cleanup to durable outbox
teamleaderleo 9476171
fix(cloud): reject malformed cleanup outbox rows
teamleaderleo c88cab9
fix(cloud): validate cleanup outbox shape
teamleaderleo 7d38261
Merge commit '5663c1354b7af3d13aa73f11ccd2486893de2c20' into repair/p…
teamleaderleo 38aab80
Persist explicit destroy cleanup for retry
teamleaderleo 97ea8f2
Merge remote-tracking branch 'mf/main' into repair/pr15359-lifecycle
teamleaderleo 14ecc77
fix cloud observed cleanup retries and concurrent migration
teamleaderleo e6d35b1
fix migration retry for invalid concurrent indexes
teamleaderleo 563b960
Merge origin/main into fix/cloud-cleanup-outbox-followup
teamleaderleo 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
Some comments aren't visible on the classic Files Changed page.
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
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
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
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
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
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
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
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
12 changes: 12 additions & 0 deletions
12
web/db/migrations/20260928120000_cloud_vm_observed_destroy_cleanup_index/migration.sql
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 @@ | ||
| CREATE INDEX "cloud_vms_observed_destroy_cleanup_idx" | ||
| ON "cloud_vms" ("updated_at", "id") | ||
| WHERE "status" = 'destroyed' | ||
| AND "provider_metadata" ? 'cmuxObservedDestroyCleanup' | ||
| AND jsonb_typeof("provider_metadata"->'cmuxObservedDestroyCleanup') = 'object' | ||
| AND ( | ||
| "provider_metadata"->'cmuxObservedDestroyCleanup' @> '{"modelPlane":true}'::jsonb | ||
| OR ( | ||
| jsonb_typeof("provider_metadata"->'cmuxObservedDestroyCleanup'->'homeVolume') = 'string' | ||
| AND length(btrim("provider_metadata"->'cmuxObservedDestroyCleanup'->>'homeVolume')) > 0 | ||
| ) | ||
| ); | ||
45 changes: 45 additions & 0 deletions
45
web/db/migrations/20260928123000_cloud_vm_observed_destroy_cleanup_outbox/migration.sql
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,45 @@ | ||
| CREATE TABLE "cloud_vm_observed_destroy_cleanups" ( | ||
| "vm_id" uuid PRIMARY KEY NOT NULL, | ||
| "provider" "vm_provider" NOT NULL, | ||
| "cleanup" jsonb NOT NULL, | ||
| "updated_at" timestamp with time zone DEFAULT now() NOT NULL, | ||
| CONSTRAINT "cloud_vm_observed_destroy_cleanups_pending_step" CHECK ( | ||
| coalesce( | ||
| jsonb_typeof("cleanup") = 'object' | ||
| AND ("cleanup" - 'modelPlane' - 'homeVolume') = '{}'::jsonb | ||
| AND ( | ||
| NOT ("cleanup" ? 'modelPlane') | ||
| OR "cleanup"->'modelPlane' = 'true'::jsonb | ||
| ) | ||
| AND ( | ||
| NOT ("cleanup" ? 'homeVolume') | ||
| OR ( | ||
| jsonb_typeof("cleanup"->'homeVolume') = 'string' | ||
| AND length(btrim("cleanup"->>'homeVolume')) > 0 | ||
| ) | ||
| ) | ||
| AND ("cleanup" ? 'modelPlane' OR "cleanup" ? 'homeVolume'), | ||
| false | ||
| ) | ||
| ) | ||
| ); | ||
|
|
||
| CREATE INDEX "cloud_vm_observed_destroy_cleanups_updated_idx" | ||
| ON "cloud_vm_observed_destroy_cleanups" ("updated_at", "vm_id") | ||
| WHERE coalesce( | ||
| jsonb_typeof("cleanup") = 'object' | ||
| AND ("cleanup" - 'modelPlane' - 'homeVolume') = '{}'::jsonb | ||
| AND ( | ||
| NOT ("cleanup" ? 'modelPlane') | ||
| OR "cleanup"->'modelPlane' = 'true'::jsonb | ||
| ) | ||
| AND ( | ||
| NOT ("cleanup" ? 'homeVolume') | ||
| OR ( | ||
| jsonb_typeof("cleanup"->'homeVolume') = 'string' | ||
| AND length(btrim("cleanup"->>'homeVolume')) > 0 | ||
| ) | ||
| ) | ||
| AND ("cleanup" ? 'modelPlane' OR "cleanup" ? 'homeVolume'), | ||
| false | ||
| ); |
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
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
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.
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.