Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patroni update changed state from "running" to "streaming" for replica nodes #28

Closed
log1-c opened this issue Jul 24, 2023 · 3 comments · Fixed by #30
Closed

patroni update changed state from "running" to "streaming" for replica nodes #28

log1-c opened this issue Jul 24, 2023 · 3 comments · Fixed by #30
Assignees
Labels
bug Something isn't working

Comments

@log1-c
Copy link

log1-c commented Jul 24, 2023

With the latest update to v3.0.4 patroni changed it state string for replica nodes
https://patroni.readthedocs.io/en/latest/releases.html#version-3-0-4

# patronictl -c /opt/patroni/etc/postgresql.yml list
+ Cluster: postgres ------------+---------+-----------+----+-----------+
| Member        | Host          | Role    | State     | TL | Lag in MB |
+---------------+---------------+---------+-----------+----+-----------+
| xyz-abcd-db01 | 11.111.1.111  | Leader  | running   | 66 |           |
| xyz-abcd-db02 | 11.111.1.111  | Replica | streaming | 66 |         0 |
| xyz-abcd-db03 | 11.111.1.111  | Replica | streaming | 66 |         0 |
+---------------+---------------+---------+-----------+----+-----------+

Sadly I couldn't quite figure out how the counting is done exactly or I would have included a PR.

Cheers and a big thanks for the check!

@log1-c
Copy link
Author

log1-c commented Aug 11, 2023

Possible fix:

Change line 37 of check_patroni/cluster.py to

yield nagiosplugin.Metric("state_running", status_counters["running"] + status_counters.get("streaming", 0))

That way it is also compatible with previous versions

@blogh
Copy link
Collaborator

blogh commented Aug 14, 2023

Hi sorry for the long delay, I was in holiday.
Will look into this asap.

@blogh blogh added the bug Something isn't working label Aug 14, 2023
blogh added a commit to blogh/check_patroni that referenced this issue Aug 18, 2023
Since patroni 3.0.4, standby node nominal state is "streaming" instead
of "running". Some services need to be changed to account for that.

Reported in issue dalibo#28
blogh added a commit to blogh/check_patroni that referenced this issue Aug 18, 2023
Since patroni 3.0.4, standby node nominal state is "streaming" instead
of "running". Some services need to be changed to account for that.

Reported in issue dalibo#28
@blogh blogh mentioned this issue Aug 18, 2023
blogh added a commit to blogh/check_patroni that referenced this issue Aug 18, 2023
Since patroni 3.0.4, standby node nominal state is "streaming" instead
of "running". Some services need to be changed to account for that.

Reported in issue dalibo#28
@blogh blogh self-assigned this Aug 18, 2023
blogh added a commit that referenced this issue Aug 21, 2023
Since patroni 3.0.4, standby node nominal state is "streaming" instead
of "running". Some services need to be changed to account for that.

Reported in issue #28
blogh added a commit to blogh/check_patroni that referenced this issue Aug 21, 2023
Since patroni 3.0.4, standby node nominal state is "streaming" instead
of "running". Some services need to be changed to account for that.

Reported in issue dalibo#28
@blogh
Copy link
Collaborator

blogh commented Aug 21, 2023

Hello,

I made some additional changes beyond my initial plan. While the check you originally
suggested was satisfactory, the performance data it provided turned out to be misleading:

CLUSTERNODECOUNT OK - members is 2 | members=2 role_leader=1 role_replica=1 state_running=2 state_streaming=1

To address this, I introduced a new healthy_members performance data value,
combining running and streaming nodes statuses. This adjustment ensures that
we continue monitoring the same states as before and maintain accurate checks.

The revised output of the check is as follows:

CLUSTERNODECOUNT OK - members is 2 | healthy_members=2 members=2 role_leader=1 role_replica=1 state_running=1 state_streaming=1

The key modifications are:

* The existing `--running-[warning|critical]` option is now designated
  as `--healthy-[warning|critical]`.
* Introduction of the `healthy_member` perfdata, which serves as the
  reference point for the aforementioned options.
* Updates to documentation, help messages, and tests.

I plan to commit these changes soon and will be addressing a few other issues throughout the week. Hopefully, I'll be able to finalize a new release by the end of the week.

Thank you.

@blogh blogh closed this as completed in #30 Aug 21, 2023
blogh added a commit that referenced this issue Aug 21, 2023
Since patroni 3.0.4, standby node nominal state is "streaming" instead
of "running". Some services need to be changed to account for that.

Reported in issue #28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants