Re:PostgreSQL's fsync surprise
by cryptonector on Thursday May 03, 2018 @12:48AM
(#16983419)
Here's a simpler fix: when the underlying device produces an error then mark the in-core inode (not on disk) as having an error and have all further writes return EIO. Then fsync() too can notice the error state flag being set and also return EIO.
[ Parent
| on HN ]
That's similar to Willy Tarreau's suggestion and suffers from the same issue - it only works up until that inode gets evicted due to memory pressure.
Re:PostgreSQL's fsync surprise
by cryptonector on Thursday May 03, 2018 @10:17AM
(#16986236)
PG could keep it open. I know it doesn't, but it could and should.
Also, perhaps the error flag should keep the inode in core. Note that the pages would still get thrown out, so as far as memory pressure this is not the end of the world.