Re: Missing data_sync_elevel() for some calls of pg_fsync()? - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: Missing data_sync_elevel() for some calls of pg_fsync()?
Date
Msg-id CAMsr+YGkAmdjhTwW1a4AbJsu-oLfMHcNeRW=jXqkQ6d=H3Ly3A@mail.gmail.com
Whole thread Raw
In response to Re: Missing data_sync_elevel() for some calls of pg_fsync()?  (Thomas Munro <thomas.munro@gmail.com>)
List pgsql-hackers
On Mon, 2 Dec 2019 at 13:43, Thomas Munro <thomas.munro@gmail.com> wrote:

1.  Some code opens a file, writes some stuff to it, closes, and then
fsyncs it, and if that fails and and it ever retries it'll redo all of
those steps again.  We know that some kernels might have thrown away
the data, but we don't care about the copy in the kernel's cache
because we'll write it out again next time around.

Can we trust the kernel to be reporting the EIO or ENOSPC only from writeback buffers for the actual file we're fsync()ing though? Not from buffers it flushed while performing our fsync() request, failed to flush, and complained about?

I'm not confident I want to assume that.
--
 Craig Ringer                   http://www.2ndQuadrant.com/
 2ndQuadrant - PostgreSQL Solutions for the Enterprise

pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Missing data_sync_elevel() for some calls of pg_fsync()?
Next
From: Craig Ringer
Date:
Subject: Re: Add a GUC variable that control logical replication