Re: Writing WAL files - Mailing list pgsql-general

From Michael Lewis
Subject Re: Writing WAL files
Date
Msg-id CAHOFxGosVP6OKEgBHrt4gEuA5mcVUTsKhhjGMtYTaks6ojgx3g@mail.gmail.com
Whole thread Raw
In response to Re: Writing WAL files  (Robert Inder <robert@interactive.co.uk>)
Responses Re: Writing WAL files  (Robert Inder <robert@interactive.co.uk>)
Re: Writing WAL files  ("Peter J. Holzer" <hjp-pgsql@hjp.at>)
List pgsql-general

I suggest that in PG12 you can monitor the
"lag" of a standby server more directly by looking at columns write_lag,
flush_lag, replay_lag in the pg_stat_replication view. 

And are those things updated when there are no changes to the master database?
If so, can anyone make the case that continually checking and updating them (how often?) wastes fewer electrons than shipping an empty file every few minutes?

Or are they only measured when something is updated?

If you setup a scripted process to update a single row with a timestamptz on the source/primary every minute, then you have a very simple consistent change and also a way to check on the replica what is current time vs last_scripted_update_time if you will and know the approx lag. It would seem like a simple albeit hacky solution to you wanting a file every X minutes regardless of server activity.

By the by, top-posting (reply above all quoted text) is discouraged on these groups.

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: UUID generation problem
Next
From: Adrian Klaver
Date:
Subject: Re: UUID generation problem