Repository navigation
Conversation
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: 61% test, 39% code, <1% docs (1,994 lines changed)
During an HA topology migration, the operator can request a drain for a pooler that is still the registered primary in the source topology. The destination may have no registration for that pooler, but that does not prove the source stopped serving or can no longer promote it. Removing the pooler in that state can interrupt writes. A persisted drain can also delete the source primary after a configuration rollback, even if the operator never verified it was safe to remove.
Fix
HA topology migrations now block with
TopologyMigrationBlockedwhile pool Pods still point to another topology or their management identity cannot be verified. The operator does not start or advance drains during the hold. Shard and Pod events drive recovery, including removal of ownerless Pods without themanaged-bylabel. A scoped, metadata-only informer sees those Pods without opening an unfiltered fleet watch. The parent stops scheduling its topology retirement timer during the manual hold.Drain requests record the Pod UID, Shard UID, and Shard generation. The controller rejects stale or unstamped intent before it can reach either drain consumer, even if the reported hold condition was lost. A matching stamp establishes provenance, not that the drain is still needed or safe.
Tests
Whole-controller regressions cover a registered source primary, unreachable source topology, rollback after status loss, legacy poolers, ownerless wakeups, and the parent timer. Reverting the protections reproduced primary disruption and a stranded migration. Generation, vet, lint, integration, and the full suite passed, including manager teardown. Runtime e2e was not run.
Risks
Operators must now use supervised fencing and retirement of the source poolers, or restore the previous topology configuration. Unstamped in-flight drains are dropped on upgrade and can be requested again if still needed. In a synthetic 5,000-cluster benchmark the supplemental informer added no objects when all Pods had their management label. With all 15,000 pool Pods missing that label, it retained about 24.3 MB for metadata and the namespace index.