Skip to content

[Bug]: A failing replication slot blocks synchronization and cleanup of every other slot on a standby #11113

Description

@mnencia

Is there an existing issue already for this bug?

  • 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.

Cluster resource

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added
    bug 🐛
    triage
    on Jul 2, 2026
  2. removed
    triage
    on Jul 2, 2026
  3. added theissue type on Jul 2, 2026
  4. added a commit that references this issue on Jul 3, 2026
    4bff663
  5. added 3 commits that reference this issue on Jul 9, 2026
    87b7fae
    741bfe0
    911ecdd
  6. added a commit that references this issue on Jul 9, 2026
    0dd9e42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions