mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-09-30 14:01:46 +02:00
restart master first in some edge cases (#1655)
* restart master first in some edge cases * edge case is when desired is lower than effective * wait after config patch and restart on sync whenever we see pending_restart * convert options to int to check decrease and add unit test * minor update to e2e tests * wait only after restart not every sync * using spilo 14 e2e images
This commit is contained in:
@@ -238,16 +238,12 @@ func (p *Patroni) Restart(server *v1.Pod) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
memberData, err := p.GetMemberData(server)
|
||||
if err != nil {
|
||||
if err := p.httpPostOrPatch(http.MethodPost, apiURLString+restartPath, buf); err != nil {
|
||||
return err
|
||||
}
|
||||
p.logger.Infof("Postgres server successfuly restarted in pod %s", server.Name)
|
||||
|
||||
// do restart only when it is pending
|
||||
if !memberData.PendingRestart {
|
||||
return nil
|
||||
}
|
||||
return p.httpPostOrPatch(http.MethodPost, apiURLString+restartPath, buf)
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetMemberData read member data from patroni API
|
||||
|
||||
Reference in New Issue
Block a user