Detect when streaming replication stops streaming.

From: Anders Wegge Keller <wegge(at)wegge(dot)dk>
To: pgsql-admin(at)postgresql(dot)org
Subject: Detect when streaming replication stops streaming.
Date: 2018-10-04 10:13:22
Message-ID: 20181004121322.39ebda6c@linuxawk.wegge.dk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Is there a reliable way to detect, on the standby, that continuous recovery
have stopped for any reason? I'm adding a postgres 9.2(1) database to an
industrial control system that have to run unattended. Thus, I need to plan
for some really exotic failure modes, like e.g. loss of network connectivity
in an indefinitely long period.

On the master system, I can check for the existence of the proper row in
pg_stat_replication. If that is missing, I can report a degraded status on
the whole system. However, on the standby side, I've been unable to find
something similar. Especially the failure mode where the standby return from
a long period of no network connectivity, where the master no longer have
the WAL segments needed to catch up. Snooping for FATAL in
pg_log/Postgres-xxx is error prone, and I'd rather not go the route of
polling the master system for a situation that should be detectable on the
standby instance.

--
//Wegge

1. Yes, I know it's no longer supported, but that's the way of redhat.

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Joakim Lundgren 2018-10-04 11:19:45 Takes long time to "fail back" using pg_rewind
Previous Message priyanka chatterjee 2018-10-04 05:06:05 Re: Regarding Google Code In 2018 Mentor