RE: Newly created replication slot may be invalidated by checkpoint

From: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: 'Amit Kapila' <amit(dot)kapila16(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, Vitaly Davydov <v(dot)davydov(at)postgrespro(dot)ru>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, suyu(dot)cmj <mengjuan(dot)cmj(at)alibaba-inc(dot)com>, tomas <tomas(at)vondra(dot)me>, michael <michael(at)paquier(dot)xyz>, bharath(dot)rupireddyforpostgres <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Subject: RE: Newly created replication slot may be invalidated by checkpoint
Date: 2026-01-08 04:55:05
Message-ID: TY7PR01MB145545B169E58036C37B6BEBEF585A@TY7PR01MB14554.jpnprd01.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear Amit,

> However, if required, we can
> move LogStandbySnapshot() and XLogFlush() outside the loop similar to
> 16 and above branches. OTOH, doing minimal changes in bank branches
> and that too in 15 and 14 to fix this issue seems like a prudent
> choice.

Per my understanding, minimizing the code changes for backbracnhes is more
important unless it is really needed.
I cannot come up with cases in core that other processes acquire {all partitions of locks,
ProcArrayLock, XidGenLock} first then ReplicationSlotAllocationLock, which can cause
deadlocks.
We cannot completely ensure all extensions because some of them may be
proprietary one, but such extensions rarely exist.
We can fix later if someone reports such deadlocks.

Best regards,
Hayato Kuroda
FUJITSU LIMITED

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2026-01-08 05:12:44 Re: POC: enable logical decoding when wal_level = 'replica' without a server restart
Previous Message Jacob Jackson 2026-01-08 04:51:41 Re: Proposal: Add a UNIQUE NOT ENFORCED constraint