fix(shard): recheck cohort before PVC deletion - #656
Draft
niconosenzo wants to merge 1 commit into
Draft
niconosenzo wants to merge 1 commit into
niconosenzo wants to merge 1 commit into
Conversation
niconosenzo
force-pushed
the
recheck-pvc-before-hard-deletion
branch
from
September 16, 2026 09:02
b733d2e to
09791b7
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
niconosenzo
force-pushed
the
recheck-pvc-before-hard-deletion
branch
from
September 16, 2026 09:18
09791b7 to
8d2bf9b
Compare
This comment has been minimized.
This comment has been minimized.
Preserve the pod and PVC until current consensus state confirms the pooler is absent from the committed cohort. Signed-off-by: Nicolas Nosenzo <niconosenzo@gmail.com>
niconosenzo
force-pushed
the
recheck-pvc-before-hard-deletion
branch
from
September 16, 2026 09:46
8d2bf9b to
755da4b
Compare
🔬 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.
Description
Before hard-deleting an excess PVC during scale-down, re-read topology and pooler consensus state to confirm the removed pooler is absent from the committed cohort. The pooler's identity is rebuilt from its
--service-idso it matches real CohortMembers entries. While absence cannot be proven (or the pooler is still a member) the pod and PVC are retained and the reconcile requeues, the first deferral is stamped on the pod. If confirmation still fails after 10 minutes the PVC is orphaned for retention-window GC instead of deleted and the pod is released (Warning PVCCleanupFallback), so a persistent failure cannot wedge scale-down. DRAINED (data known-bad) pods skip the recheck: orch already ejected them and holding the pod would pin the ordinal slot. Only the topology primary is queried.Changes
drain.multigres.com/pvc-cleanup-deferred-since.Testing
go test ./pkg/data-handler/posture ./pkg/resource-handler/controller/shard