Repository navigation
Prevent primary-replica handover gaps during rolling deployment - #18
Merged
Merged
Conversation
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.
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.