Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oGeel-0007wg-Sq for pgsql-general@arkaria.postgresql.org; Wed, 27 Jul 2022 10:52:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oGeek-0000AD-Lu for pgsql-general@arkaria.postgresql.org; Wed, 27 Jul 2022 10:52:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oGeek-00009z-5c for pgsql-general@lists.postgresql.org; Wed, 27 Jul 2022 10:52:46 +0000 Received: from campbell-lange.net ([178.79.140.51]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oGeeh-00010N-AS for pgsql-general@lists.postgresql.org; Wed, 27 Jul 2022 10:52:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=campbell-lange.net; s=it; h=Content-Type:MIME-Version:Message-ID:Subject:To :From:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Og+wOJBdkS8uncDKC2SC8McSwl0h1uASsea1vbx1Hko=; b=GlGUyXU7+gxOWHGVYZEI0CwgHk S7+++i5TBq6wtufJvmEwEldH7jxuprN7mTfecBoijFTDqRYI7mu28SZiTPcVlRgvZuyVBsgA48Z4v MKhl2pqCaYWQeysCWRb1pBYLmxj1NERpB3TozUqks4O8usp1qWzT4FeB+nlUZ362I9DI=; Received: from [217.138.52.158] (helo=rory-t470s) by campbell-lange.net with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oGeef-006jom-16 for pgsql-general@lists.postgresql.org; Wed, 27 Jul 2022 10:52:41 +0000 Received: from rory by rory-t470s with local (Exim 4.94.2) (envelope-from ) id 1oGeee-004vu7-Bd for pgsql-general@lists.postgresql.org; Wed, 27 Jul 2022 11:52:40 +0100 Date: Wed, 27 Jul 2022 11:52:40 +0100 From: Rory Campbell-Lange To: pgsql-general@lists.postgresql.org Subject: monitor health of native logical replication Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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