Re: Corruption during WAL replay
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>, tejeswarm@hotmail.com, pgsql-hackers@postgresql.org, hexexpert@comcast.net
Date: 2020-04-11T00:54:31Z
Lists: pgsql-hackers
Hi, On 2020-04-10 20:49:05 -0400, Alvaro Herrera wrote: > On 2020-Mar-30, Andres Freund wrote: > > > If we are really concerned with truncation failing - I don't know why we > > would be, we accept that we have to be able to modify files etc to stay > > up - we can add a pre-check ensuring that permissions are set up > > appropriately to allow us to truncate. > > I remember I saw a case where the datadir was NFS or some other network > filesystem thingy, and it lost connection just before autovacuum > truncation, or something like that -- so there was no permission > failure, but the truncate failed and yet PG soldiered on. I think the > connection was re-established soon thereafter and things went back to > "normal", with nobody realizing that a truncate had been lost. > Corruption was discovered a long time afterwards IIRC (weeks or months, > I don't remember). Yea. In that case we're in a really bad state. Because we truncate after throwing away the old buffer contents (even if dirty), we'll later read page contents "from the past". Which won't end well... Greetings, Andres Freund
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