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>
Cc: Vitaly Davydov <v(dot)davydov(at)postgrespro(dot)ru>, 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>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Subject: RE: Newly created replication slot may be invalidated by checkpoint
Date: 2025-11-11 04:03:11
Message-ID: OSCPR01MB149661FA366D017DF7CAB0D12F5CFA@OSCPR01MB14966.jpnprd01.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear Amit,

> We need to check whether a similar change is required in
> reserve_wal_for_local_slot() as well for sync slots.

Good point. I confirmed similar issue could happen while synchronizing slots.
PSA the reproducer.

0001-PG17... patch simulates the issue that WAL segments were discarded in-between
slot's restart_lsn is set and the pointed record is being protected. Can be
applied atop PG17.
0001-HEAD... patch simulates the issue that restart_lsn obtained from primary is
discarded on standby. This can be applied atop HEAD.

Best regards,
Hayato Kuroda
FUJITSU LIMITED

Attachment Content-Type Size
0001-PG17-Invalidate-newly-synchronized-slots.patch application/octet-stream 4.5 KB
0001-HEAD-invalidate-newly-synchronized-slot.patch application/octet-stream 6.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2025-11-11 04:05:13 Re: POC: enable logical decoding when wal_level = 'replica' without a server restart
Previous Message Peter Smith 2025-11-11 03:44:54 Re: Is this a typo?