Re: Corruption during WAL replay
Masahiko Sawada <sawada.mshk@gmail.com>
From: Masahiko Sawada <sawada.mshk@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>,
Teja Mupparti <tejeswarm@hotmail.com>, Kyotaro Horiguchi <horikyota.ntt@gmail.com>, "masahiko.sawada@2ndquadrant.com" <masahiko.sawada@2ndquadrant.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, "hexexpert@comcast.net" <hexexpert@comcast.net>
Date: 2020-11-06T11:40:54Z
Lists: pgsql-hackers
On Tue, Aug 18, 2020 at 3:22 AM Andres Freund <andres@anarazel.de> wrote: > > Hi, > > On 2020-08-17 14:05:37 +0300, Heikki Linnakangas wrote: > > On 14/04/2020 22:04, Teja Mupparti wrote: > > > Thanks Kyotaro and Masahiko for the feedback. I think there is a > > > consensus on the critical-section around truncate, > > > > +1 > > I'm inclined to think that we should do that independent of the far more > complicated fix for other related issues. +1 If we had a critical section in RelationTruncate(), crash recovery would continue failing until the situation of the underlying file is recovered if a PANIC happens. The current comment in RelationTruncate() says it’s worse than the disease. But considering physical replication, as Andres mentioned, a failure to truncate the file after logging WAL is no longer a harmless failure. Also, the critical section would be necessary even if we reversed the order of truncation and dropping buffers and resolved the issue. So I agree to proceed with the patch that adds a critical section independent of fixing other related things discussed in this thread. If Teja seems not to work on this I’ll write the patch. Regards, -- Masahiko Sawada EnterpriseDB: https://www.enterprisedb.com/
Commits
-
Harden TAP tests that intentionally corrupt page checksums.
- d09f765b9dcb 12.11 landed
- 6e9ffcf13a4a 13.7 landed
- 579cef5faf11 14.3 landed
- 3d263b09058a 11.16 landed
- 174877f1e344 15.0 landed
-
Fix possible recovery trouble if TRUNCATE overlaps a checkpoint.
- 412ad7a55639 15.0 landed
- 57f618310f83 10.21 landed
- 118f1a332b00 11.16 landed
- 3821d66a7b3e 12.11 landed
- 1ce14b6b2fe4 13.7 landed
- bbace5697df1 14.3 landed
-
Remember to reset yy_start state when firing up repl_scanner.l.
- ef9706bbc8ce 14.2 cited