Skip to content

Commit 39bd425

Browse files
authored
Sync mode reloaded part 2 (#574)
* Double check config * Logging * Especially double check when bootstrapping * Check for new value * Revert "Especially double check when bootstrapping" This reverts commit f1ca8db. * Especially double check when bootstrapping * Revert "Check for new value" This reverts commit 4ecb5f5. * Fix typos
1 parent df06f64 commit 39bd425

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

controllers/postgres_controller.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ func (r *PostgresReconciler) checkAndUpdatePatroniReplicationConfig(log logr.Log
10411041
if len(leaderPods.Items) != 1 {
10421042
log.V(debugLogLevel).Info("expected exactly one leader pod, selecting all spilo pods as a last resort (might be ok if it is still creating)")
10431043
// To make sure any updates to the Zalando postgresql manifest are written, we do not requeue in this case
1044-
return allDone, r.updatePatroniReplicationConfigOnAllPods(log, ctx, instance)
1044+
return requeueAfterReconcile, r.updatePatroniReplicationConfigOnAllPods(log, ctx, instance)
10451045
}
10461046
leaderIP := leaderPods.Items[0].Status.PodIP
10471047

@@ -1058,18 +1058,18 @@ func (r *PostgresReconciler) checkAndUpdatePatroniReplicationConfig(log logr.Log
10581058

10591059
if instance.IsReplicationPrimary() {
10601060
if resp.StandbyCluster != nil {
1061-
log.V(debugLogLevel).Info("standby_cluster mistmatch, requeing", "response", resp)
1061+
log.V(debugLogLevel).Info("standby_cluster mismatch, requeing", "response", resp)
10621062
return requeueAfterReconcile, nil
10631063
}
10641064
if instance.Spec.PostgresConnection.SynchronousReplication {
10651065
if resp.SynchronousNodesAdditional == nil || *resp.SynchronousNodesAdditional != instance.Spec.PostgresConnection.ConnectedPostgresID {
1066-
log.V(debugLogLevel).Info("synchronous_nodes_additional mistmatch, updating", "response", resp)
1067-
return allDone, r.httpPatchPatroni(log, ctx, instance, leaderIP)
1066+
log.V(debugLogLevel).Info("synchronous_nodes_additional mismatch, updating and requeing", "response", resp)
1067+
return requeueAfterReconcile, r.httpPatchPatroni(log, ctx, instance, leaderIP)
10681068
}
10691069
} else {
10701070
if resp.SynchronousNodesAdditional != nil {
1071-
log.V(debugLogLevel).Info("synchronous_nodes_additional mistmatch, updating", "response", resp)
1072-
return allDone, r.httpPatchPatroni(log, ctx, instance, leaderIP)
1071+
log.V(debugLogLevel).Info("synchronous_nodes_additional mismatch, updating and requeing", "response", resp)
1072+
return requeueAfterReconcile, r.httpPatchPatroni(log, ctx, instance, leaderIP)
10731073
}
10741074
}
10751075

@@ -1079,23 +1079,23 @@ func (r *PostgresReconciler) checkAndUpdatePatroniReplicationConfig(log logr.Log
10791079
return requeueAfterReconcile, nil
10801080
}
10811081
if resp.StandbyCluster.ApplicationName != instance.ObjectMeta.Name {
1082-
log.V(debugLogLevel).Info("application_name mismatch, updating", "response", resp)
1083-
return allDone, r.httpPatchPatroni(log, ctx, instance, leaderIP)
1082+
log.V(debugLogLevel).Info("application_name mismatch, updating and requeing", "response", resp)
1083+
return requeueAfterReconcile, r.httpPatchPatroni(log, ctx, instance, leaderIP)
10841084
}
10851085
if resp.SynchronousNodesAdditional != nil {
1086-
log.V(debugLogLevel).Info("synchronous_nodes_additional mistmatch, updating", "response", resp)
1087-
return allDone, r.httpPatchPatroni(log, ctx, instance, leaderIP)
1086+
log.V(debugLogLevel).Info("synchronous_nodes_additional mismatch, updating and requeing", "response", resp)
1087+
return requeueAfterReconcile, r.httpPatchPatroni(log, ctx, instance, leaderIP)
10881088
}
10891089
if resp.StandbyCluster.CreateReplicaMethods == nil {
1090-
log.V(debugLogLevel).Info("create_replica_methods mismatch, updating", "response", resp)
1090+
log.V(debugLogLevel).Info("create_replica_methods mismatch, updating and requeing", "response", resp)
10911091
return requeueAfterReconcile, r.httpPatchPatroni(log, ctx, instance, leaderIP)
10921092
}
10931093
if resp.StandbyCluster.Host != instance.Spec.PostgresConnection.ConnectionIP {
1094-
log.V(debugLogLevel).Info("host mismatch, requeing", "updating", resp)
1094+
log.V(debugLogLevel).Info("host mismatch, updating and requeing", "updating", resp)
10951095
return requeueAfterReconcile, r.httpPatchPatroni(log, ctx, instance, leaderIP)
10961096
}
10971097
if resp.StandbyCluster.Port != int(instance.Spec.PostgresConnection.ConnectionPort) {
1098-
log.V(debugLogLevel).Info("port mismatch, requeing", "updating", resp)
1098+
log.V(debugLogLevel).Info("port mismatch, updating and requeing", "updating", resp)
10991099
return requeueAfterReconcile, r.httpPatchPatroni(log, ctx, instance, leaderIP)
11001100
}
11011101
}

0 commit comments

Comments
 (0)