Add sync_standby as an acceptable state for a replica

This commit is contained in:
benoit 2023-08-21 13:07:20 +02:00 committed by Benoit
parent 021b572e53
commit a01a535680
4 changed files with 4 additions and 4 deletions

View file

@ -166,7 +166,7 @@ Usage: check_patroni cluster_has_replica [OPTIONS]
A healthy replica:
* is in running or streaming state (V3.0.4)
* has a replica role
* has a replica or sync_standby role
* has a lag lower or equal to max_lag
Check:

View file

@ -324,7 +324,7 @@ def cluster_has_replica(
\b
A healthy replica:
* is in running or streaming state (V3.0.4)
* has a replica role
* has a replica or sync_standby role
* has a lag lower or equal to max_lag
\b

View file

@ -91,7 +91,7 @@ class ClusterHasReplica(PatroniResource):
unhealthy_replica = 0
for member in item_dict["members"]:
# FIXME are there other acceptable states
if member["role"] == "replica":
if member["role"] in ["replica", "sync_standby"]:
# patroni 3.0.4 changed the standby state from running to streaming
if (
member["state"] in ["running", "streaming"]

View file

@ -21,7 +21,7 @@
},
{
"name": "srv3",
"role": "replica",
"role": "sync_standby",
"state": "running",
"api_url": "https://10.20.199.5:8008/patroni",
"host": "10.20.199.5",