monitor health of native logical replication - Mailing list pgsql-general

From Rory Campbell-Lange
Subject monitor health of native logical replication
Date
Msg-id YuEY+KJfUefgb4sN@campbell-lange.net
Whole thread Raw
List pgsql-general
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






pgsql-general by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re:
Next
From: Wiwwo Staff
Date:
Subject: Feature request: psql --idle