Re: Synchronizing slots from primary to standby

From: "Drouvot, Bertrand" <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: shveta malik <shveta(dot)malik(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Ajin Cherian <itsajin(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Subject: Re: Synchronizing slots from primary to standby
Date: 2023-10-27 15:30:20
Message-ID: 681e1874-0a79-4a01-8536-f358f37fd3f0@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 10/27/23 10:35 AM, Amit Kapila wrote:
> On Wed, Oct 25, 2023 at 3:15 PM Drouvot, Bertrand
>
> I think even if we provide such an API, we need to have logic to get
> the slots from the primary and create them.

Yeah, my idea was to add an API (in addition to what is already in place).

> Say, even if the user used
> the APIs, there may still be some new slots that the sync worker needs
> to create.

Right.

> I think it might be better to provide a view for users to
> view the current state of sync. For example, in the above case, we can
> say "waiting for the primary to advance remote LSN" or something like
> that.

We are already displaying the wait event "ReplSlotsyncPrimaryCatchup" in pg_stat_activity
so that might already be enough?

My main idea was to be able to manually create/sync logical_slot2 in the test case described in [1]
without waiting for activity on logical_slot1.

But another (better?) option might be to change our current algorithm during slot creation on the
standby? (to avoid an "active" slot having to wait on a "inactive" one, like described in [1]).

[1]: https://www.postgresql.org/message-id/afe4ab6c-dde3-48ea-acd8-6f6052c7b8fd%40gmail.com

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Laurenz Albe 2023-10-27 15:49:42 Re: Version 14/15 documentation Section "Alter Default Privileges"
Previous Message Drouvot, Bertrand 2023-10-27 15:21:45 Re: Synchronizing slots from primary to standby