-
Notifications
You must be signed in to change notification settings - Fork 51
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
new check: streaming_delay #206
Conversation
…ing behind its master
6f316f6
to
7856835
Compare
Hi, I just looked at this PR. Actually, we didn't implement it previously because the underlying function is not really helpful. It unfortunately doesn't return the replication lag, but the time since some data has been received and replayed. So if there's no write activity on the primary server, this service will probably trigger some false errors. If we were to accept this check, it'd have to be renamed to something like "received_activity_from_primary" or something that makes clear what's it's actually checking. About the code:
|
Hi, So this PR has been softly rejected since 5 years already. Let's close it for good. However, this feature request will be supported through some other means using Cheers, |
Oh ... this one went under my radar. I don't have responsibility for any primary-slave postgresql setups at the moment, so this is no priority for me, but I still think it may be useful for primary-slave environments where continuous write activity is expected. If the slave is lagging behind, then something is most likely wrong. I could blow the dust of this one and rename it - but if nobody finds it useful, then let it be :-) |
Any reason why you want the service on the secondary rather than the primary? Are the write_lag and replay_lag from pg_stat_replication enough? |
Long time since I was playnig with this, but on the primary server you can only check that there exists a slave that is up-to-date. Theoretically things may be set up wrongly so that there is another slave connected to the master, so I think it's nice to check from the slave point of view that it's connected, too. I believe that in November 2018 I was playing around with disaster recovery situations where a slave was switched to master, new slaves were taken up or taken down, etc. |
Hi,
No, from
so the idea is to use the
Yes, but you can setup check_pga to explicitly check the streaming to some specific standbies using their application_name + remote IP address, using eg: |
I still feel it would be simpler and easier being able to check from a specific slave if it's connected to the master than to do it from the master, but I won't waste time arguing at that - and for the foreseeable future I'm not going to monitor any postgresql slave servers anyway :-) |
Sure, it would be possible, why not. However, you can not check the lag from the standby point of view.
Thank you very much for your past discussions and contributions Tobias! Cheers, |
measuring how much a slave server is lagging behind its master.
This one is a bit similar to the existing streaming_delta check, except the delta check is supposed to be run from the master, and it measures the data delta in bytes, not the time delta in seconds. In some settings one would probably like to get a quick alert if the slave is significantly lagged compared to the master, even if the data delta size is small.
(requested by a customer of ours)