| From: | Michael Paquier <michael(at)paquier(dot)xyz> |
|---|---|
| To: | Rita <rmorgan466(at)gmail(dot)com> |
| Cc: | Ben Chobot <bench(at)silentmedia(dot)com>, "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org> |
| Subject: | Re: Pause streaming replication |
| Date: | 2021-11-11 02:41:27 |
| Message-ID: | YYyC16hVjNJ5Rcvl@paquier.xyz |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On Wed, Nov 10, 2021 at 08:36:45PM -0500, Rita wrote:
> Yes, I have read the manual and seen this. It pauses the replication
> (select pg_is_wal_replay_paused()). But on the primary, when I look at
> pg_stat_replication, it still says 'streaming' in the state column. My
> question was how do I get it from 'streaming' to anything else? (
> https://www.postgresql.org/docs/11/monitoring-stats.html#PG-STAT-REPLICATION-VIEW)
> ?
pg_is_wal_replay_paused() pauses WAL *replay* at recovery, but it does
not stop the stream of WAL from the primary to its standbys.
> I want to trigger an alert when 'streaming' isn't there. Or is there a
> better way to do it?
If you want to have some automated test to check a given state of the
replication, you could use a combination of a SIGSTOP on the WAL
receiver of the standby and/or the WAL sender of the primary, with
some pg_terminate_backend() calls, just to throw one idea in the
bucket.
--
Michael
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Laurenz Albe | 2021-11-11 07:21:12 | Re: Pause streaming replication |
| Previous Message | Ben Chobot | 2021-11-11 01:51:11 | Re: Pause streaming replication |