From: Rory Campbell-Lange <rory@campbell-lange.net>
To: pgsql-general@lists.postgresql.org
Subject: monitor health of native logical replication
Date: Wed, 27 Jul 2022 11:52:40 +0100
Message-ID: <YuEY+KJfUefgb4sN@campbell-lange.net> (raw)
Based on my initial testing native logical replication seems easier and faster
to setup than pglogical, and may be easier for our team to administer.
One sticking point is monitoring the health of native logical replication.
Are there some native logical replication functions or calls that can, for
example, provide info such as the function pglogical.show_subscription_status?
if (pglogical_worker_running(apply))
{
PGLogicalSyncStatus *sync;
sync = get_subscription_sync_status(sub->id, true);
if (!sync)
status = "unknown";
else if (sync->status == SYNC_STATUS_READY)
status = "replicating";
else
status = "initializing";
}
else if (!sub->enabled)
status = "disabled";
else
status = "down";
The native pg_stat_subscription view does not show, for example, if the
subscription is down.
Rory
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: rory@campbell-lange.net
Subject: Re: monitor health of native logical replication
In-Reply-To: <YuEY+KJfUefgb4sN@campbell-lange.net>
References: <YuEY+KJfUefgb4sN@campbell-lange.net>
* 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