Skip to content

Prevent primary-replica handover gaps during rolling deployment - #18

Merged
PaulHorn merged 3 commits into
mainfrom
codex/foody-rollout-drain
Nov 1, 2026
Merged

PaulHorn merged 3 commits into
mainfrom
codex/foody-rollout-drain

Conversation

@PaulHorn

@PaulHorn PaulHorn commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

A continuous Foody production probe observed a brief 502 during a redundant API rollout. The redeploy path replaced its primary replica while it was still routed; later replicas were drained first. Container replacement also used forced removal, interrupting in-flight work.

Drain the primary out of ingress before replacement and admit it only after dependency readiness and revision attestation. Stop when ingress synchronization fails, restore routing during rollback, and give running old containers a 30-second graceful shutdown window before removal. Single-replica replacement and immutable revision adoption retain their existing behavior.

Validation: typecheck, web build, all 143 isolated test files, and 15 focused replacement/container tests pass. New regressions cover serving traffic throughout primary replacement, failed ingress removal, unready admission and graceful-stop failure. The image/container runtime code is the only operational change; no schema migration is introduced.

A second observed API failure window coincided with synchronous panel backup work blocking the request thread used for Foody storage authorization. Snapshotting, integrity validation, serialization, compression and encryption now run on a background worker; backup format and upload verification are retained. A regression verifies event-loop responsiveness during compression and round-trip recovery. Backup integration tests pass, including restoration of encrypted credentials. All 144 isolated test files pass, plus typecheck and the focused replacement tests.

@PaulHorn
PaulHorn merged commit d65bd56 into main Nov 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant