Closed SDV109 closed 1 month ago
@SDV109 I think we need to wait for the return of code 200
, which means a successful switchover. Use 'until
', the example in the subsequent task of this file.
Depending on the situation, requests might return different HTTP status codes and bodies. Status code 200 is returned when the switchover or failover successfully completed. If the switchover was successfully scheduled, Patroni will return HTTP status code 202. In case something went wrong, the error status code (one of 400, 412, or 503) will be returned with some details in the response body.
@vitabaks, Fixed
FIX switchover in
update_pgcluster.yml
with the old version of patroni.In the old version of patroni(example 2.1.4), the keyword Master was used, not Primary, which is why switchover does not work on older versions of Patroni. This fix uses the Patroni API, tested on version 2.1.4.
Doc: https://patroni.readthedocs.io/en/latest/rest_api.html#switchover-and-failover-endpoints