Skip to content

fix: update phase when rollout blocked by WAL receiver - #9931

Open
usiegj00 wants to merge 1 commit into
cloudnative-pg:mainfrom
buildio:fix/replica-cluster-phase-update
Open

usiegj00 wants to merge 1 commit into
cloudnative-pg:mainfrom
buildio:fix/replica-cluster-phase-update

Conversation

@usiegj00

@usiegj00 usiegj00 commented Feb 7, 2026

Copy link
Copy Markdown

Summary

When a cluster with primaryUpdateMethod: switchover needs a rollout, the operator may block waiting for the WAL receiver to be active on the switchover target. This left a stale phase message ("Waiting for instances to become active") that was confusing since all pods were actually running.

This follows the existing pattern for errRolloutDelayed by updating the cluster phase to reflect the actual blocking condition.

Changes

  • Add PhaseWaitingForWalReceiver constant
  • Update phase when errLogShippingReplicaElected is returned (same pattern as errRolloutDelayed at lines 1117-1131)

Test plan

  • All existing controller tests pass (252 specs)
  • E2E test with replica cluster + switchover (manual verification done)

Fixes: #9919

When a cluster with primaryUpdateMethod: switchover needs a rollout,
the operator may block waiting for the WAL receiver to be active on
the switchover target. Previously, this left a stale phase message
("Waiting for instances to become active") that was confusing since
all pods were actually running.

This follows the existing pattern for errRolloutDelayed (lines 1117-1131)
by updating the cluster phase to reflect the actual blocking condition.

Fixes: cloudnative-pg#9919

Signed-off-by: Jonathan Siegel <[email protected]>
@usiegj00
usiegj00 requested a review from a team February 7, 2026 04:31
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Feb 7, 2026
@cnpg-bot cnpg-bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.25 release-1.28 labels Feb 7, 2026
@github-actions

github-actions Bot commented Feb 7, 2026

Copy link
Copy Markdown
Contributor

❗ By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested ◀️ or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

@dosubot dosubot Bot added the bug 🐛 Something isn't working label Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-requested ◀️ This pull request should be backported to all supported releases bug 🐛 Something isn't working release-1.28 release-1.30 size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Replica cluster with primaryUpdateMethod: switchover gets stuck when WAL receiver inactive

3 participants