fix(repartition): the reclaim must delete the pod, not just the claim #2161
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/repartition-reclaim-pod"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Every node in the first fleet run stalled on this and needed clearing by hand.
Deleting the PVC, PV and ZFSVolume is not enough. The controller's pod outlives the claim, stays bound to a PV that no longer exists, and the scheduler reports:
for ever. CNPG never re-provisions the instance, the cluster holds at 4/5, and the green gate — correctly, because
cnpg-not-readyis a real predicate — burns its budget waiting. That cost 40m48s on the first node before the pod was deleted by hand, after which the operator built a fresh instance in ~100 seconds (postgres-6returned aspostgres-12).scripts/k3s-remove-node.shPhase 3 force-deleted the bound pod. That step was dropped in the port. This restores it.Two details that matter
Order is load-bearing.
pvc-protectionholds a PVC inTerminatingwhile any pod still references it, so the claim delete stays--wait=falseand the pod delete follows it. Reversing them deadlocks the claim instead.Pods are resolved by the claim they actually mount (
spec.volumes[].persistentVolumeClaim.claimName), not by name coincidence — CNPG happens to name the pod after the claim, MinIO does not.Verified by mutation
the reclaim never force-deletes the pod bound to a reclaimed claimthe pod delete must FOLLOW the --wait=false claim delete (pvc=390 pod=389)My first attempt at those mutations silently passed because the test strings had the wrong indentation and never applied. They're now done by line number, so a no-op edit can't masquerade as a passing guard.
tests/check.sh— 147/147.https://claude.ai/code/session_01MdSbMhzabSbpG8TtP9Ur3H