From: Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
To: pgsql-admin@lists.postgresql.org
Subject: Re: Hick ups in Postgresql Logical Replication
Date: Tue, 16 Oct 2018 19:07:29 +1300
Message-ID: <0eccff47-a5d8-56d3-8474-610378ad96d0@catalyst.net.nz> (raw)
In-Reply-To: <1539667567051-0.post@n3.nabble.com>
References: <1539447741900-0.post@n3.nabble.com>
<20427d4e-98a5-0cda-bddc-070989015cca@catalyst.net.nz>
<1539598263562-0.post@n3.nabble.com>
<81cfab86-c6dc-89a1-5685-7589e4f81f9d@catalyst.net.nz>
<1539667567051-0.post@n3.nabble.com>
Hi again,
On 16/10/18 18:26, pavan95 wrote:
>
> Hi Mark,
>
> My question was like how to get all the LSN's that are available in a WAL
> segment. For example, take a segment named "000000010000000000000051".
>
> So in the above archive log segment, how to get all the LSN's of all txn's
> which belong to that segment ?
>
> *The idea for asking this is, I will get the remote_lsn on the subscriber
> which was successfully applied from the view "pg_replication_origin_status".
>
> Based on the LSN, I will check in which archive segment that particular LSN
> is present(as you said above).
>
> And will find all the later LSN's(later to remote_lsn).
>
> So I can say that these many transactions are yet to be applied to the
> target.*
>
>
Well I think you are going to have to do a bit of work here to determine
when the file name changes (e.g my system):
bench=# SELECT pg_walfile_name('0/51EB3BAE');
pg_walfile_name
--------------------------
000000010000000000000051
(1 row)
bench=# SELECT pg_walfile_name('0/50000001');
pg_walfile_name
--------------------------
000000010000000000000050
(1 row)
However, I'm not sure you are chasing the right problem. It seems to me
that you need to grapple with what is (possibly) wrong with the
streaming wal protocol used by logical rep, not the wal file business.
Again, I recommend you provide a precise test case that shows the
problem, we can surely help you then!
regards
Mark
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: mark.kirkwood@catalyst.net.nz, pgsql-admin@lists.postgresql.org
Subject: Re: Hick ups in Postgresql Logical Replication
In-Reply-To: <0eccff47-a5d8-56d3-8474-610378ad96d0@catalyst.net.nz>
* 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