Re: Movement of restart_lsn position movement of logical replication slots is very slow - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Movement of restart_lsn position movement of logical replication slots is very slow
Date
Msg-id CAA4eK1+2EAiffL1abpf=OjQ1JQC0SL=sVqHnjAUP+WpzbuZvqQ@mail.gmail.com
Whole thread Raw
In response to Re: Movement of restart_lsn position movement of logical replication slots is very slow  (Jammie <shailesh.jamloki@gmail.com>)
Responses Re: Movement of restart_lsn position movement of logical replication slots is very slow
List pgsql-hackers
On Tue, Dec 15, 2020 at 11:00 AM Jammie <shailesh.jamloki@gmail.com> wrote:
>
> Thanks Amit for the response
>
> We are using pgJDBC sample program here
> https://jdbc.postgresql.org/documentation/head/replication.html
>
> the setFlushLSN is coming from the pgJDBC only.
>
> git hub for APIs of pgJDBC methods available.
>
> https://github.com/pgjdbc/pgjdbc
>
> The second slot refers to "private" slot.
>
> So ""we are not doing reading from the stream' ==> It means that we are having readPending call only from the shared
slotthen we get the lastReceivedLSN() from stream and
 
> send it back to stream as confirmed_flush_lsn for both private and shared slot. We dont do readPending call to
privateslot. we will use private slot only when we dont have choice. It is kind of reserver slot for us.
 
>

I think this (not performing read/decode on the private slot) could be
the reason why it lagging behind. If you want to use as a reserve slot
then you probably want to at least perform
pg_replication_slot_advance() to move it to the required position. The
restart_lsn won't move unless you read/decode from that slot.

-- 
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Add session statistics to pg_stat_database
Next
From: Konstantin Knizhnik
Date:
Subject: Re: On login trigger: take three