Re: BUG #18426: Canceling vacuum while truncating a relation leads to standby PANIC
Alexander Law <exclusion@gmail.com>
From: Alexander Lakhin <exclusion@gmail.com>
To: pgsql-bugs@lists.postgresql.org
Date: 2024-04-10T18:00:00Z
Lists: pgsql-bugs
Attachments
- bug-18426-demo.patch (text/x-patch) patch
10.04.2024 14:00, PG Bug reporting form wrote: > The following bug has been logged on the website: > > Bug reference: 18426 > ... > A demo test for the issue to follow... Please try the attached patch (for REL_16_STABLE), which: 1) adds a delay inside InvalidateBuffer() to allow for canceling the operation here. 2) invokes ProcessInterrupts() which would be called if (buf_state & BM_IO_IN_PROGRESS) inside ConditionVariableSleep() -> ConditionVariableTimedSleep(). (If you find these changes non-legitimate, I'll look for another approach.) 3) contains test 099_stream_vacuum, based on 027_stream_regress. make -s check -C src/test/recovery/ PROVE_TESTS="t/099*" fails for me (roughly on 1 of 2 runs) just like in the case observed in the wild: ... 2024-04-10 17:20:54.521 UTC|||6616ca5a.26a393|WARNING: page 90 of relation base/16402/16929 does not exist 2024-04-10 17:20:54.521 UTC|||6616ca5a.26a393|CONTEXT: WAL redo at 0/DCD12AC0 for Heap2/VISIBLE: snapshotConflictHorizon: 0, flags: 0x03; blkref #0: rel 1663/16402/16929, fork 2, blk 0; blkref #1: rel 1663/16402/16929, blk 90 2024-04-10 17:20:54.521 UTC|||6616ca5a.26a393|PANIC: WAL contains references to invalid pages 2024-04-10 17:20:54.521 UTC|||6616ca5a.26a393|CONTEXT: WAL redo at 0/DCD12AC0 for Heap2/VISIBLE: snapshotConflictHorizon: 0, flags: 0x03; blkref #0: rel 1663/16402/16929, fork 2, blk 0; blkref #1: rel 1663/16402/16929, blk 90 2024-04-10 17:20:54.532 UTC|||6616ca5a.26a390|LOG: startup process (PID 2532243) was terminated by signal 6: Aborted ... Best regards, Alexander
Commits
-
Fix corruption when relation truncation fails.
- 2280912165d6 13.19 landed
- 23c743b645a5 14.16 landed
- fb540b6aa5ab 15.11 landed
- ba02d24bacbb 16.7 landed
- 0350b876b074 17.3 landed
- 38c579b08988 18.0 landed
-
Replace buffer I/O locks with condition variables.
- d87251048a0f 14.0 cited