RE: ReplicationSlotRelease() crashes when the instance is in the single user mode

From: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
Cc: "'pgsql-hackers(at)lists(dot)postgresql(dot)org'" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, 'Michael Paquier' <michael(at)paquier(dot)xyz>
Subject: RE: ReplicationSlotRelease() crashes when the instance is in the single user mode
Date: 2025-02-19 02:57:34
Message-ID: OSCPR01MB14966F234CD3121F51810D5CCF5C52@OSCPR01MB14966.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear hackers,

Based on the discussion, I feel it is enough to add quick error out for SQL functions. PSA attached.

Best regards,
Hayato Kuroda
FUJITSU LIMITED

> -----Original Message-----
> From: Hayato Kuroda (Fujitsu) <kuroda(dot)hayato(at)fujitsu(dot)com>
> Sent: Tuesday, February 18, 2025 5:24 PM
> To: 'Michael Paquier' <michael(at)paquier(dot)xyz>
> Cc: 'pgsql-hackers(at)lists(dot)postgresql(dot)org' <pgsql-hackers(at)lists(dot)postgresql(dot)org>
> Subject: RE: ReplicationSlotRelease() crashes when the instance is in the single
> user mode
>
> Dear Michael,
>
> > Ah, good point for the slot drop. So 0ce5cf2ef24f is claiming that
> > some of these manipulations are OK. I didn't suspect this one.
>
> Yeah, I think so.
>
> > Slot advancing is a very different beast, unfortunately, that may
> > depend on many other subsystems. For example with logical slots we
> > would finish by calling rm_decode, which could be outside of core.
> > Justifying that this operation is supported in single-user mode is
> > larger than what you are suggesting here..
>
> OK. Actually, I do not have any use-cases in my mind. I played because
> I found a special path for single user mode in ReplicationSlotAcquire()
> so that I wanted to see the behavior.
>
> Best regards,
> Hayato Kuroda
> FUJITSU LIMITED
>
>

Attachment Content-Type Size
0001-Prohibit-slot-operations-while-in-the-single-user-mo.patch application/octet-stream 2.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2025-02-19 03:13:47 Re: test_escape: invalid option -- 'c'
Previous Message Tender Wang 2025-02-19 02:47:31 Re: Unsafe access BufferDescriptors array in BufferGetLSNAtomic()