Re: 035_standby_logical_decoding unbounded hang

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: 035_standby_logical_decoding unbounded hang
Date: 2024-02-16 06:37:38
Message-ID: Zc8CshXLZylDWPL2@ip-10-97-1-34.eu-west-3.compute.internal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Thu, Feb 15, 2024 at 12:48:16PM -0800, Noah Misch wrote:
> On Wed, Feb 14, 2024 at 03:31:16PM +0000, Bertrand Drouvot wrote:
> > What about creating a sub, say wait_for_restart_lsn_calculation() in Cluster.pm
> > and then make use of it in create_logical_slot_on_standby() and above? (something
> > like wait_for_restart_lsn_calculation-v1.patch attached).
>
> Waiting for restart_lsn is just a prerequisite for calling
> pg_log_standby_snapshot(), so I wouldn't separate those two.

Yeah, makes sense.

> If we're
> extracting a sub, I would move the pg_log_standby_snapshot() call into the sub
> and make the API like one of these:
>
> $standby->wait_for_subscription_starting_point($primary, $slot_name);
> $primary->log_standby_snapshot($standby, $slot_name);
>
> Would you like to finish the patch in such a way?

Sure, please find attached standby-slot-test-2-race-v2.patch doing so. I used
log_standby_snapshot() as it seems more generic to me.

Regards,

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

Attachment Content-Type Size
standby-slot-test-2-race-v2.patch text/x-diff 2.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hayato Kuroda (Fujitsu) 2024-02-16 06:41:37 RE: speed up a logical replica setup
Previous Message Amit Kapila 2024-02-16 06:13:54 Re: Synchronizing slots from primary to standby