Re: Persist slot invalidations before publishing them - Mailing list pgsql-hackers

From Bertrand Drouvot
Subject Re: Persist slot invalidations before publishing them
Date
Msg-id arI8AEPtq4EtgzWL@bdtpg
Whole thread
In response to Re: Persist slot invalidations before publishing them  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: Persist slot invalidations before publishing them
List pgsql-hackers
Hi JoongHyuk,

On Sun, Sep 13, 2026 at 07:31:57PM +0900, JoongHyuk Shin wrote:
> Hi Bertrand,
> 
> I read v2 and have a question about the window the new ordering opens
> between two invalidators.

Thanks for looking at it!

> If a second invalidator reaches the
> same slot in that window (say a restartpoint enforcing
> max_slot_wal_keep_size while startup is replaying a wal_level change, or
> the other way round), it seems it would take the "slot is in use" path,
> so startup might send a recovery conflict to active_pid, or another
> process a SIGTERM. What do you think?

You're right, v2 could treat the first invalidator as a regular slot user and
terminate it.

Rui, thanks for the patch! I've incorporated its locking approach and test coverage
in v3, with some adjustments around error cleanup.

Please find v3 attached.

Regards,

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

Attachment

pgsql-hackers by date:

Previous
From: shveta malik
Date:
Subject: Re: sequencesync worker race with REFRESH SEQUENCES
Next
From: Ajit Awekar
Date:
Subject: Re: [(known) BUG] DELETE/UPDATE more than one row in partitioned foreign table