Re: Pause streaming replication

From: Ben Chobot <bench(at)silentmedia(dot)com>
To: Rita <rmorgan466(at)gmail(dot)com>
Cc: "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 01:51:11
Message-ID: 2b7b26f6-d00b-edad-7ea6-160c699219d3@silentmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Paquier 2021-11-11 02:41:27 Re: Pause streaming replication
Previous Message Rita 2021-11-11 01:36:45 Re: Pause streaming replication