-
Notifications
You must be signed in to change notification settings - Fork 4
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
cluster_has_replica: fix the way a healthy replica is detected #54
Conversation
cf #50 |
I still need to fix the tests and try on older supported python versions. |
c108093
to
341ac64
Compare
If I read the changes correctly, this also adds the timeline to the perfdata? That might warrant a release notes item as well then. |
You are right, I changed it. I'll probably continue next week. |
3f10734
to
1b35de2
Compare
d251383
to
0684e1e
Compare
8a19b12
to
5e20507
Compare
Hi @mbanck, Do you want to review it ? |
I think this is still wrong. From PostgreSQL's perspective, a healthy standby could be It checks things like :
So I think we should do something like
I don't know what to do about nodes with a |
I guess I am also not sure what to do about |
For patroni >= version 3.0.4: * the role is `replica` or `sync_standby` * the state is `streaming` or `in archive recovery` * the timeline is the same as the leader * the lag is lower or equal to `max_lag` For prio versions of patroni: * the role is `replica` or `sync_standby` * the state is `running` * the timeline is the same as the leader * the lag is lower or equal to `max_lag` Additionnally, we now display the timeline in the perfstats. We also try to display the perf stats of unhealthy replica as much as possible. Update tests for cluster_has_replica: * Fix the tests to make them work with the new algotithm * Add a specific test for tl divergences
59d9bca
to
8c15e72
Compare
@dlax could you have another look please ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
For patroni >= version 3.0.4:
For prio versions: