[check_postgres] hot standby delay

Guillaume Lelarge guillaume at lelarge.info
Sun May 26 16:19:57 UTC 2013


On Sun, 2013-05-19 at 17:41 +0200, Filip Rembiałkowski wrote:
> Hi
> 
> Subject action worked for me when I was using streaming replication,
> 
> When I switched same pair of servers to WAL shipping, it always returns the
> master offset (a large number).
> 
> But  I can calculate real delay value manually, by substracting
> pg_last_xlog_replay_location() on slave from pg_current_xlog_location() on
> master.
> 
> It would be nice and useful if the action returned useful value of delay
> regardless if it is streaming or log shipping.
> 
> What do you think?
> 

You get two values: replay and receive delays. The replay value should
be good. The receive value is only available when using the streaming
replication. PostgreSQL itself doesn't give us the right value. So you
should take that complaint to them :)

Though we could still check the receive return value. If it's NULL, we
shouldn't supply the receive delay as it doesn't make sense. See patch
attached.


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hotstandbyreplay.patch
Type: text/x-patch
Size: 2291 bytes
Desc: not available
URL: <https://mail.endcrypt.com/pipermail/check_postgres/attachments/20130526/86f4ae0e/attachment.bin>


More information about the Check_postgres mailing list