Add sync_standby as an acceptable state for a replica
This commit is contained in:
parent
021b572e53
commit
a01a535680
|
@ -166,7 +166,7 @@ Usage: check_patroni cluster_has_replica [OPTIONS]
|
||||||
|
|
||||||
A healthy replica:
|
A healthy replica:
|
||||||
* is in running or streaming state (V3.0.4)
|
* 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
|
* has a lag lower or equal to max_lag
|
||||||
|
|
||||||
Check:
|
Check:
|
||||||
|
|
|
@ -324,7 +324,7 @@ def cluster_has_replica(
|
||||||
\b
|
\b
|
||||||
A healthy replica:
|
A healthy replica:
|
||||||
* is in running or streaming state (V3.0.4)
|
* 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
|
* has a lag lower or equal to max_lag
|
||||||
|
|
||||||
\b
|
\b
|
||||||
|
|
|
@ -91,7 +91,7 @@ class ClusterHasReplica(PatroniResource):
|
||||||
unhealthy_replica = 0
|
unhealthy_replica = 0
|
||||||
for member in item_dict["members"]:
|
for member in item_dict["members"]:
|
||||||
# FIXME are there other acceptable states
|
# 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
|
# patroni 3.0.4 changed the standby state from running to streaming
|
||||||
if (
|
if (
|
||||||
member["state"] in ["running", "streaming"]
|
member["state"] in ["running", "streaming"]
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "srv3",
|
"name": "srv3",
|
||||||
"role": "replica",
|
"role": "sync_standby",
|
||||||
"state": "running",
|
"state": "running",
|
||||||
"api_url": "https://10.20.199.5:8008/patroni",
|
"api_url": "https://10.20.199.5:8008/patroni",
|
||||||
"host": "10.20.199.5",
|
"host": "10.20.199.5",
|
||||||
|
|
Loading…
Reference in a new issue