Repository navigation
Conversation
Signed-off-by: Brent Graveland <graveland@supabase.io>
Signed-off-by: Brent Graveland <graveland@supabase.io>
Signed-off-by: Brent Graveland <graveland@supabase.io>
Signed-off-by: Brent Graveland <graveland@supabase.io>
Signed-off-by: Brent Graveland <graveland@supabase.io>
🔬 Go Test Coverage ReportSummary
Status✅ PASS DetailShow New Coverage |
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.
Diff: 53% test, 41% code, 5% generated, 1% docs (3,355 lines changed)
A pooler can be quarantined while it still advertises the
PRIMARYrouting role. Shard status previously showed only quarantine, and the remediation path could then delete the primary's Pod and hard-delete its data PVC. Quarantine indicates a lifecycle problem; it does not prove that a pooler has stopped serving writes or cannot be promoted.Fix
Publish primary routing and quarantine evidence independently, and retain an observed quarantined Pod by UID even if its lifecycle later clears. Quarantine remediation reports the hold without deleting the Pod or its claim. Drain cleanup and terminal replacement check lifecycle before deletion and use Kubernetes UID and resourceVersion preconditions. Ordinary rollout and scale-down of non-quarantined primaries keep their existing behavior and retry. A follow-up PR for backup-destination reporting stacks on this one.
Tests
Whole-controller regressions cover overlapping topology records, legacy quarantine during partial reads, persisted drains, Pod replacement races, and both trusted-source and supervised topology clearance. Mutation checks caught regressions in those protections. The locked integration and full controller suites passed on the production-code tip; the combined focused controller tests passed again after the final test-only additions.
Risks
Remediation is now report-only, so quarantined replicas also require supervised recovery. The Shard records the previous configured topology's endpoint, backend identity, and TLS references. Pod arguments never supply a dial target. If trusted history is missing, cleanup holds until an operator fences the old topology and explicitly records supervised clearance for that source and Shard generation.
A topology-only quarantine or promotion can still land between the last lifecycle read and the Kubernetes delete. The preconditions protect the Kubernetes object, not topology. Closing this residual race requires a Multigres promotion-side fence held through deletion.
A held drain can incur one live Pod GET and one PVC GET per pass to find and withdraw an orphan mark. Cleanup can open the destination store twice, with additional bounded source checks during migration. These checks do not add healthy-path polling. Repeated warnings share Kubernetes' correlated, rate-limited Event budget, so Shard status is the durable signal.