You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: A failing replication slot blocks synchronization and cleanup of every other slot on a standby #11113
I have searched for an existing issue, and could not find anything. I believe this is a new bug.
I have read the troubleshooting guide
I have read the troubleshooting guide and I think this is a new bug.
I am running a supported version of CloudNativePG
I have read the troubleshooting guide and I think this is a new bug.
Contact Details
No response
Version
trunk (main)
What version of Kubernetes are you using?
Not applicable, this is a logic bug in the replication slot reconciliation code and is not specific to any Kubernetes version.
What is your Kubernetes environment?
Not applicable, same as above.
How did you install the operator?
Not applicable, same as above.
What happened?
synchronizeReplicationSlots (internal/management/controller/slots/runner/runner.go) is responsible for keeping a standby's local replication slots in sync with the primary's, and for deleting stale slots on the standby. It loops over the slots reported by the primary and calls infrastructure.Create/infrastructure.Update for each one; on the first error returned by either call, the function returns immediately.
Because of this early return, if processing any single slot fails, every slot that would have been synchronized afterward in that same loop iteration is skipped, and the second loop that deletes stale/orphaned slots on the standby never runs at all, since the function has already returned.
This means one problematic replication slot (for any reason it might fail to create/advance) silently stops synchronization and cleanup of every other HA replication slot on that standby. Since this runs on a fixed ticker with no per-slot error isolation, the same slot fails the same way on every subsequent cycle, so the effect is permanent until the offending slot is removed out-of-band.
What I expected: an error while processing one replication slot should not prevent the other slots from being synchronized, and should not prevent the stale-slot cleanup pass from running.
Activity
fix: don't stop replication slot reconciliation at the first failing …
fix: don't stop replication slot reconciliation at the first failing …
fix: don't stop replication slot reconciliation at the first failing …
fix: don't stop replication slot reconciliation at the first failing …
fix: don't stop replication slot reconciliation at the first failing …