Re: Postgres, fsync, and OSs (specifically linux)
Craig Ringer <craig@2ndquadrant.com>
From: Craig Ringer <craig@2ndquadrant.com>
To: Andres Freund <andres@anarazel.de>
Cc: Thomas Munro <thomas.munro@enterprisedb.com>,
Simon Riggs <simon@2ndquadrant.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2018-04-30T02:46:00Z
Lists: pgsql-hackers
> Not quite sure what you're getting at with "a file we don't fsync" - if > we don't, we don't care about durability anyway, no? Or do you mean > where we fsync in a different process? Right. > Either way, the answer is mostly no: On NFS et al where close() implies > an fsync you'll get the error at that time, otherwise you'll get it at > the next fsync(). Thanks. The reason I ask is that if we got notified of already-detected writeback errors (on 4.13+) on close() too, it'd narrow the window a little for problems, since normal backends could PANIC if close() of a persistent file raised EIO. Otherwise we're less likely to see the error, since the checkpointer won't see it - it happened before the checkpointer open()ed the file. It'd still be no help for dirty writeback that happens after we close() in a user backend / the bgwriter and before we re-open(), but it'd be nice if the kernel would tell us on close() if it knows of a writeback error. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
Commits
-
PANIC on fsync() failure.
- 9ccdd7f66e33 12.0 landed
- f1ff5f51d249 9.4.21 landed
- 312435232217 9.5.16 landed
- b9cce9ddfa17 9.6.12 landed
- afbe03f65470 10.7 landed
- 6534d544cd77 11.2 landed
-
Fix and improve pg_atomic_flag fallback implementation.
- 8c3debbbf618 11.0 cited