From: Stephen Frost <sfrost@snowman.net>
To: Craig Ringer <craig@2ndquadrant.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Postgres, fsync, and OSs (specifically linux)
Date: Sat, 28 Apr 2018 11:21:20 -0400
Message-ID: <20180428152120.GS27724@tamriel.snowman.net> (raw)
In-Reply-To: <CAMsr+YGz+9cEs88aq0hBbFvz1pFNGBVPNd1qsJNLkgJLhpDFag@mail.gmail.com>
References: <20180427222842.in2e4mibx45zdth5@alap3.anarazel.de>
<CAMsr+YGz+9cEs88aq0hBbFvz1pFNGBVPNd1qsJNLkgJLhpDFag@mail.gmail.com>
Greetings,
* Craig Ringer (craig@2ndquadrant.com) wrote:
> On 28 April 2018 at 06:28, Andres Freund <andres@anarazel.de> wrote:
> > - Add a pre-checkpoint hook that checks for filesystem errors *after*
> > fsyncing all the files, but *before* logging the checkpoint completion
> > record. Operating systems, filesystems, etc. all log the error format
> > differently, but for larger installations it'd not be too hard to
> > write code that checks their specific configuration.
>
> I looked into using trace event file descriptors for this, btw, but
> we'd need CAP_SYS_ADMIN to create one that captured events for other
> processes. Plus filtering the events to find only events for the files
> / file systems of interest would be far from trivial. And I don't know
> what guarantees we have about when events are delivered.
>
> I'd love to be able to use inotify for this, but again, that'd only be
> a new-kernels thing since it'd need an inotify extension to report I/O
> errors.
>
> Presumably mostly this check would land up looking at dmesg.
>
> I'm not convinced it'd get widely deployed and widely used, or that
> it'd be used correctly when people tried to use it. Look at the
> hideous mess that most backup/standby creation scripts,
> archive_command scripts, etc are.
Agree with more-or-less everything you've said here, but a big +1 on
this. If we do end up going down this route we have *got* to provide
scripts which we know work and have been tested and are well maintained
on the popular OS's for the popular filesystems and make it clear that
we've tested those and not others. We definitely shouldn't put
something in our docs that is effectively an example of the interface
but not an actual command that anyone should be using.
Thanks!
Stephen
Attachments:
signature.asc (application/pgp-signature, 818B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: sfrost@snowman.net, craig@2ndquadrant.com, andres@anarazel.de
Subject: Re: Postgres, fsync, and OSs (specifically linux)
In-Reply-To: <20180428152120.GS27724@tamriel.snowman.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox