From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: bricklen <bricklen@gmail.com>
To: Doug Gorley <doug@gorley.ca>
Cc: pgsql-general@postgresql.org
Subject: Re: How to monitor logical replication initial sync?
Date: Mon, 9 Apr 2018 14:09:06 -0400
Message-ID: <6ea88d04-45cb-1737-c89b-871c6f79f809@2ndquadrant.com> (raw)
In-Reply-To: <CAGrpgQ91Sh+y18FhsbsSQVQSnuT72e=TA7x8AFXjuw6n4dsoWA@mail.gmail.com>
References: <201803072323.w27NNcvr009303@mail70c0.megamailservers.com>
<CAGrpgQ91Sh+y18FhsbsSQVQSnuT72e=TA7x8AFXjuw6n4dsoWA@mail.gmail.com>
On 3/15/18 09:19, bricklen wrote:
> How does one monitor the status or progress of an initial sync under
> logical replication? For example:
>
> * I create a publication in database db_pub
> * I create a subscription in database db_sub
> * In 15 minutes I want to check an see that the initial sync is N%
> complete
>
> Is it possible to tell when the initial sync is complete, or better
> yet, how complete it is?
>
>
> This is a question I'm quite interested in as well (and one I do not
> have an answer to).
>
> Does anyone with more familiarity with logical replication have any
> suggestions on how to determine the status of the initial sync?
Something like
select * from pg_subscription_rel where srsubstate <> 'r' and srsubid =
(select oid from pg_subscription where subname = 'mysub');
The key is checking the srsubstate column for 'r' (ready).
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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 using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: peter.eisentraut@2ndquadrant.com, bricklen@gmail.com, doug@gorley.ca, pgsql-general@postgresql.org
Subject: Re: How to monitor logical replication initial sync?
In-Reply-To: <6ea88d04-45cb-1737-c89b-871c6f79f809@2ndquadrant.com>
* 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