Re: VM corruption on standby
Kirill Reshke <reshkekirill@gmail.com>
From: Kirill Reshke <reshkekirill@gmail.com>
To: Yura Sokolov <y.sokolov@postgrespro.ru>
Cc: Thomas Munro <thomas.munro@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Andrey Borodin <x4mmm@yandex-team.ru>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Melanie Plageman <melanieplageman@gmail.com>
Date: 2025-08-19T13:43:33Z
Lists: pgsql-hackers
On Tue, 19 Aug 2025 at 18:29, Yura Sokolov <y.sokolov@postgrespro.ru> wrote: > Latch and ConditionVariable (that uses Latch) are among basic > synchronization primitives in PostgreSQL. Sure > Therefore they have to work correctly in any place: in critical section, in > wal logging, etc. No. Before bc22dc0e0ddc2dcb6043a732415019cc6b6bf683 ConditionVariable code path was never exercised in critical sections. After bc22dc0e0ddc2dcb6043a732415019cc6b6bf683 it is exercised in almost every one (if the system is highly loaded). This is a crucial change with corruption as a drawback (until we fix this). To replace proc_exit(1) with _exit(2) is not a cure too: if we exit inside CRIT section without any message to LWLock contenders, they will never do the same (never exit), because they are wait the semaphore and do not respond to signals (so, only way to stop them in to kill-9). Before bc22dc0e0ddc2dcb6043a732415019cc6b6bf683 lwlock holders did not exit inside crit sections (unless kill9) I had one suggestion about what can be done [0]. However there is little no time until the pg18 release for a change that scary and big (my own understanding), so the safest option is to revert. [0] https://www.postgresql.org/message-id/CALdSSPgDAyqt%3DORyLMWMpotb9V4Jk1Am%2Bhe39mNtBA8%2Ba8TQDw%40mail.gmail.com -- Best regards, Kirill Reshke
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Revert "Get rid of WALBufMappingLock"
- 2ce6abdf5085 18.0 landed
- c13070a27b63 19 (unreleased) landed
-
Get rid of WALBufMappingLock
- bc22dc0e0ddc 18.0 cited
-
Split WaitEventSet functions to separate source file
- 393e0d231405 18.0 cited
-
Add WL_EXIT_ON_PM_DEATH pseudo-event.
- cfdf4dc4fc96 12.0 cited