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-19T17:00:53Z
Lists: pgsql-hackers
On Tue, 19 Aug 2025 at 21:16, Yura Sokolov <y.sokolov@postgrespro.ru> wrote: > > That is not true. > elog(PANIC) doesn't clear LWLocks. And XLogWrite, which is could be called > from AdvanceXLInsertBuffer, may call elog(PANIC) from several places. > > It doesn't lead to any error, because usually postmaster is alive and it > will kill -9 all its children if any one is died in critical section. > > So the problem is postmaster is already killed with SIGKILL by definition > of the issue. > > Documentation says [0]: > > If at all possible, do not use SIGKILL to kill the main postgres server. > > Doing so will prevent postgres from freeing the system resources (e.g., > shared memory and semaphores) that it holds before terminating. > > Therefore if postmaster SIGKILL-ed, administrator already have to do some > actions. > There are surely many cases when a system reaches the state which can only be fixed by admin action. The elog(PANIC) in the CRIT section is very rare (and very probably is corruption already). The simpler example is to kill-9 postmaster and then immediately kill-9 someone who holds LWLock. The problem is in pgv18 is that this state probability is much higher due to the aforementioned commit. In can happen with almost any OOM on highly loaded systems. -- 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