Fix oldest LSN calculation for WAL segments removal when slots are advancing during checkpoint

Edit
ID 5627
Title Fix oldest LSN calculation for WAL segments removal when slots are advancing during checkpoint
CI (CFBot) Summary
Stats (from CFBot) Patch count: 2, First patch: +48−0, All patches: +51−0
Topic Bug Fixes
Created 2025-03-03 14:53:27
Last modified 2025-03-03 16:35:05 (4 weeks ago)
Latest email 2025-03-03 15:12:12 (4 weeks ago)
Status
2025-07: Needs review
Target version
Authors Vitaly Davydov (vitprof)
Reviewers Become reviewer
Committer
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-03-03 15:12:12 by "Vitaly Davydov" <v.davydov at postgrespro.ru>
Latest 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>
    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)
History
When Who What
2025-03-03 16:35:05 Vitaly Davydov (vitprof) New status: Needs review
2025-03-03 14:56:05 Vitaly Davydov (vitprof) New status: Waiting on Author
2025-03-03 14:54:57 Vitaly Davydov (vitprof) Changed authors to Vitaly Davydov (vitprof)
2025-03-03 14:53:27 Vitaly Davydov (vitprof) Attached mail thread 1d12d2-67235980-35-19a406a0@63439497
2025-03-03 14:53:27 Vitaly Davydov (vitprof) Created patch record
Edit