mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-19 02:12:02 +02:00
Use Patroni API to set bootstrap-only options. (#299)
Call Patroni API /config in order to set special options that are ignored when set in the configuration file, such as max_connections. Per https://github.com/zalando-incubator/postgres-operator/issues/297 * Some minor refacoring: Rename Cluster ManualFailover to Swithover Rename Patroni Failover to Switchover Add more details to error messages and comments introduced in this PR. Review by @zerg-junior
This commit is contained in:
@@ -866,8 +866,8 @@ func (c *Cluster) GetStatus() *spec.ClusterStatus {
|
||||
}
|
||||
}
|
||||
|
||||
// ManualFailover does manual failover to a candidate pod
|
||||
func (c *Cluster) ManualFailover(curMaster *v1.Pod, candidate spec.NamespacedName) error {
|
||||
// Switchover does a switchover (via Patroni) to a candidate pod
|
||||
func (c *Cluster) Switchover(curMaster *v1.Pod, candidate spec.NamespacedName) error {
|
||||
c.logger.Debugf("failing over from %q to %q", curMaster.Name, candidate)
|
||||
|
||||
podLabelErr := make(chan error)
|
||||
@@ -889,7 +889,7 @@ func (c *Cluster) ManualFailover(curMaster *v1.Pod, candidate spec.NamespacedNam
|
||||
}
|
||||
}()
|
||||
|
||||
if err := c.patroni.Failover(curMaster, candidate.Name); err != nil {
|
||||
if err := c.patroni.Switchover(curMaster, candidate.Name); err != nil {
|
||||
close(stopCh)
|
||||
return fmt.Errorf("could not failover: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user