diff --git a/controllers/replicas.go b/controllers/replicas.go index acd3c44469..5b2dfe97a4 100644 --- a/controllers/replicas.go +++ b/controllers/replicas.go @@ -232,6 +232,11 @@ func (r *ClusterReconciler) setPrimaryOnSchedulableNode( continue } + // If the candidate has not established a connection to the current primary, skip it + if !candidate.IsWalReceiverActive { + continue + } + // Set the current candidate as targetPrimary contextLogger.Info("Current primary is running on unschedulable node, triggering a switchover", "currentPrimary", primaryPod.Pod.Name, "currentPrimaryNode", primaryPod.Node,