Re: BUG #18426: Canceling vacuum while truncating a relation leads to standby PANIC
Thomas Munro <thomas.munro@gmail.com>
From: Thomas Munro <thomas.munro@gmail.com>
To: Alexander Lakhin <exclusion@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Date: 2024-04-23T20:26:09Z
Lists: pgsql-bugs
After looking into that a bit more and rediscovering/re-remembering all the previous threads about RelationTruncate()'s failures, which d87251048a0f has made worse, I now think we should do one of two things: 1. Fix bug #18146[1]. Then this WaitIO() problem will be fixed as a side-effect. I posted a new patch over there. 2. If somehow we can't agree on that critical section in back branches (for example if we finish up deciding to do the big re-engineering project for truncation where the buffer pool has new states, ie fix in HEAD only), then at least wrap the truncation in HOLD_INTERRUPTS() for releases 14-17. [1] https://www.postgresql.org/message-id/flat/18146-04e908c662113ad5%40postgresql.org
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