Re: Pause streaming replication - Mailing list pgsql-general

From Ben Chobot
Subject Re: Pause streaming replication
Date
Msg-id 2b7b26f6-d00b-edad-7ea6-160c699219d3@silentmedia.com
Whole thread Raw
In response to Re: Pause streaming replication  (Rita <rmorgan466@gmail.com>)
List pgsql-general
Rita wrote on 11/10/21 5:36 PM:
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) ?

I want to trigger an alert when 'streaming' isn't there. Or is there a better way to do it?

Oh yes, I'm sorry. I see now that was your original question, and my suggestion doesn't help you there.

But I would say that, in my experience with monitoring streaming replication, I haven't cared so much about if the replica is streaming vs. rebuilding, but rather how far behind it has fallen when it is supposedly streaming. Pausing replication lets you see what it will look like when a disk failure blocks your replica's writes, or client activity blocks wal replay, which are absolutely situations you want to monitor for.

pgsql-general by date:

Previous
From: Rita
Date:
Subject: Re: Pause streaming replication
Next
From: Michael Paquier
Date:
Subject: Re: Pause streaming replication