Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly

Edit
ID 5770
Title Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly
CI (CFBot) Needs rebase! Needs rebase since 10 months. Failing since 10 months.
Additional links previous successfully applied patch (outdated):
Summary
Stats (from CFBot) Unknown
Tags Bugfix
Created 2025-05-22 20:50:35
Last modified 2026-02-03 22:25:12 (3 months ago)
Latest email 2025-07-21 12:09:05 (9 months ago)
Status
PG19-1 (2025-07-01 – 2025-07-31): Committed
Target version stable
Authors Vitaly Davydov (vitprof)
Reviewers Alexander Korotkov (smagen) Become reviewer
Committer Alexander Korotkov (smagen)
Links
Emails
Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly
First at 2024-10-31 10:18:34 by "Vitaly Davydov" <v.davydov at postgrespro.ru>
Latest at 2025-07-18 11:41:31 by Alexander Korotkov <aekorotkov at gmail.com>
Latest attachment (physical_replication_restart_lsn_backward.patch) at 2025-07-02 17:20:22 from vignesh C <vignesh21 at gmail.com>
    Attachment (physical_replication_restart_lsn_backward.patch) at 2025-07-02 17:20:22 from vignesh C <vignesh21 at gmail.com> (Patch: Yes)
    Attachment (0001-Update-comment-for-last_saved_restart_lsn.patch) at 2025-06-29 06:22:30 from "Hayato Kuroda (Fujitsu)" <kuroda.hayato at fujitsu.com> (Patch: Yes)
    Attachment (v1-0001-Fix-CheckPointReplicationSlots-with-max_replicati.patch) at 2025-06-25 21:50:29 from Alexander Korotkov <aekorotkov at gmail.com> (Patch: Yes)
    Attachment (tmp.diffs) at 2025-06-25 07:48:43 from "Hayato Kuroda (Fujitsu)" <kuroda.hayato at fujitsu.com> (Patch: Yes)
    Attachment (v5-0001-Remove-excess-assert-from-InvalidatePossiblyObsol.patch) at 2025-06-22 23:05:59 from Alexander Korotkov <aekorotkov at gmail.com> (Patch: Yes)
    Attachment (restart_lsn_backup_repro_v1.patch) at 2025-06-20 12:41:57 from vignesh C <vignesh21 at gmail.com> (Patch: Yes)
    Attachment (v4-0002-Remove-excess-assert-from-InvalidatePossiblyObsol.patch) at 2025-06-18 16:47:09 from Alexander Korotkov <aekorotkov at gmail.com> (Patch: Yes)
    Attachment (v3-0001-Improve-runtime-and-output-of-tests-for-replicati.patch) at 2025-06-16 11:16:42 from Alexander Korotkov <aekorotkov at gmail.com> (Patch: Yes)
    Attachment (v2-0001-Improve-runtime-and-output-of-tests-for-replicati.patch) at 2025-06-16 01:58:51 from Alexander Korotkov <aekorotkov at gmail.com> (Patch: Yes)
    Attachment (v1-0001-Fix-046_checkpoint_-logical-physical-_slot.pl-exe.patch) at 2025-06-15 11:02:44 from Alexander Korotkov <aekorotkov at gmail.com> (Patch: Yes)
    Attachment (v3-0001-Keep-WAL-segments-by-slot-s-flushed-restart-LSN.patch) at 2025-06-10 20:14:16 from Alexander Korotkov <aekorotkov at gmail.com> (Patch: Yes)
    Attachment (v2-0001-Keep-WAL-segments-by-slot-s-flushed-restart-LSN.patch) at 2025-06-03 13:21:19 from Alexander Korotkov <aekorotkov at gmail.com> (Patch: Yes)
    Attachment (v7-0003-Remove-redundant-ReplicationSlotsComputeRequiredLSN-.patch) at 2025-05-26 10:22:51 from "Vitaly Davydov" <v.davydov at postgrespro.ru> (Patch: Yes)
    Attachment (v6-0003-Remove-redundant-ReplicationSlotsComputeRequiredL.patch) at 2025-05-24 13:28:55 from Alexander Korotkov <aekorotkov at gmail.com> (Patch: Yes)
    Attachment (v5-0003-Remove-redundant-ReplicationSlotsComputeRequiredL.patch) at 2025-05-24 10:37:52 from Alexander Korotkov <aekorotkov at gmail.com> (Patch: Yes)
    Attachment (v4-0001-Keep-WAL-segments-by-the-flushed-value-of-the-slo.patch) at 2025-05-22 21:10:27 from Alexander Korotkov <aekorotkov at gmail.com> (Patch: Yes)
    Attachment (0002-Add-TAP-test-to-check-logical-repl-slot-advance-duri.v3.patch) at 2025-05-20 15:44:44 from "Vitaly Davydov" <v.davydov at postgrespro.ru> (Patch: Yes)
    Attachment (0003-Add-TAP-test-to-check-physical-repl-slot-advance-dur.v2.patch) at 2025-05-02 17:47:48 from "Vitaly Davydov" <v.davydov at postgrespro.ru> (Patch: Yes)
    Attachment (0001-Keep-WAL-segments-by-slot-s-flushed-restart-LSN.patch) at 2025-03-03 15:12:12 from "Vitaly Davydov" <v.davydov at postgrespro.ru> (Patch: Yes)
    Attachment (0001-Keep-WAL-segments-by-slot-s-flushed-restart-LSN.patch) at 2024-12-13 14:34:01 from "Vitaly Davydov" <v.davydov at postgrespro.ru> (Patch: Yes)
    Attachment (0002-TAP-test.patch) at 2024-11-21 23:05:40 from Tomas Vondra <tomas at vondra.me> (Patch: Yes)
    Attachment (restartlsn.pl) at 2024-11-21 16:13:23 from Давыдов Виталий <v.davydov at postgrespro.ru> (Patch: No)
    Attachment (0001-Keep-WAL-segments-by-slot-s-flushed-restart-LSN.patch) at 2024-11-07 13:30:39 from "Vitaly Davydov" <v.davydov at postgrespro.ru> (Patch: Yes)
    Attachment (0001-Keep-WAL-segments-by-slot-s-flushed-restart-LSN.patch) at 2024-10-31 10:32:36 from "Vitaly Davydov" <v.davydov at postgrespro.ru> (Patch: Yes)
Document slot's restart_lsn can go backward
First at 2025-07-18 11:40:49 by Alexander Korotkov <aekorotkov at gmail.com>
Latest at 2025-07-21 12:09:05 by Alexander Korotkov <aekorotkov at gmail.com>
Latest attachment (v2-0001-Update-comment-for-last_saved_restart_lsn.patch) at 2025-07-21 05:34:15 from Amit Kapila <amit.kapila16 at gmail.com>
    Attachment (v2-0001-Update-comment-for-last_saved_restart_lsn.patch) at 2025-07-21 05:34:15 from Amit Kapila <amit.kapila16 at gmail.com> (Patch: Yes)
    Attachment (0001-Update-comment-for-last_saved_restart_lsn.patch) at 2025-07-18 11:40:49 from Alexander Korotkov <aekorotkov at gmail.com> (Patch: Yes)
History
When Who What
2026-02-03 22:25:12 Álvaro Herrera (alvherre) Closed in commitfest PG19-1 with status: Committed
2026-02-03 22:24:49 Álvaro Herrera (alvherre) Attached mail thread CAPpHfdvuyMrUg0Vs5jPfwLOo1M9B-GP5j_My9URnBX0B=nrHKw@mail.gmail.com
2025-07-08 02:40:24 CFbot Patch needs rebase
2025-06-29 06:45:43 CFbot Patch does not need rebase anymore
2025-06-28 13:50:32 CFbot Patch needs rebase
2025-05-22 20:51:00 Alexander Korotkov (smagen) Added smagen as committer
2025-05-22 20:50:38 Alexander Korotkov (smagen) Added smagen as reviewer
2025-05-22 20:50:35 Alexander Korotkov (smagen) Attached mail thread 1d12d2-67235980-35-19a406a0@63439497
2025-05-22 20:50:35 Alexander Korotkov (smagen) Created patch record
Edit