pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Rita <rmorgan466@gmail.com>
Cc: Ben Chobot <bench@silentmedia.com>
Cc: " <pgsql-general@postgresql.org>
Subject: Re: Pause streaming replication
Date: Thu, 11 Nov 2021 11:41:27 +0900
Message-ID: <YYyC16hVjNJ5Rcvl@paquier.xyz> (raw)
In-Reply-To: <CAOF-Kfi7_YXDGCNcPKX_aRd1ikMLapKOooZbM0YTPZd9+CZcrA@mail.gmail.com>
References: <CAOF-KfjFT1wo-j1vO1k14niiaGr=75Daw+MM8U4+PRp9vbgTGw@mail.gmail.com>
	<476bcc51-c1e4-1fb1-24c6-07cd5f6d5d80@silentmedia.com>
	<CAOF-Kfi7_YXDGCNcPKX_aRd1ikMLapKOooZbM0YTPZd9+CZcrA@mail.gmail.com>

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

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (6+ messages)  latest in thread

Message-ID: <YYyC16hVjNJ5Rcvl@paquier.xyz>
Permalink:  ../YYyC16hVjNJ5Rcvl@paquier.xyz/
Also on:    postgresql.org/message-id/YYyC16hVjNJ5Rcvl@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: michael@paquier.xyz, rmorgan466@gmail.com, bench@silentmedia.com
  Subject: Re: Pause streaming replication
  In-Reply-To: <YYyC16hVjNJ5Rcvl@paquier.xyz>
  References: <CAOF-KfjFT1wo-j1vO1k14niiaGr=75Daw+MM8U4+PRp9vbgTGw@mail.gmail.com> <476bcc51-c1e4-1fb1-24c6-07cd5f6d5d80@silentmedia.com> <CAOF-Kfi7_YXDGCNcPKX_aRd1ikMLapKOooZbM0YTPZd9+CZcrA@mail.gmail.com> <YYyC16hVjNJ5Rcvl@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox