Re: Newly created replication slot may be invalidated by checkpoint

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
Cc: "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(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-26 09:35:59
Message-ID: 5073F4B4-35FB-4BC1-AB07-22C7498884C4@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Jan 26, 2026, at 13:35, Hayato Kuroda (Fujitsu) <kuroda(dot)hayato(at)fujitsu(dot)com> wrote:
>
> Dear Hou,
>
> Thanks for updating the patch. I ran tests and reproducer [1] for all versions.
> Confirmed the issue happened before the patch and fixed after applying them.
>
> One difference between master and others is that pg_sync_replication_slots()
> on HEAD is not returned. Because the behavior was changed by 0d2d4a0, not
> related with the fix.
>
> I feel these patches are enough good shape.
>
> [1]: https://www.postgresql.org/message-id/TY7PR01MB14554DBE84290130EB421DD28F596A%40TY7PR01MB14554.jpnprd01.prod.outlook.com
>
> Best regards,
> Hayato Kuroda
> FUJITSU LIMITED
>

Yeah, I agree v4 is solid. I have a few nitpicks:

1 - commit message
```
WAL reservation and checkpoints, this creates a race conditions where
```

Typo: a race conditions => a race condition

2 - commit message
```
before the the slotsync updates the restart_lsn. This is because in slotsync
```

Typo: the the => the

3 - slotsync.c
```
+ * This can happen because the initial restart_lsn received from the
+ * remote server can precede redo pointer. Therefore, when selecting the
```

I think we need to add “the” before “redo pointer”: the remote server can precede the redo pointer.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Daniil Davydov 2026-01-26 09:34:44 Re: Batching in executor