pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Michael Brown <michael.brown@discourse.org>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: fdatasync performance problem with large number of DB files
Date: Wed, 10 Mar 2021 20:25:05 -0500
Message-ID: <2258680.1615425905@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+hUKGJ6bpG1ghgZccJ57fpyZRHNu2xJkWRmaEP4TEBuXutS-Q@mail.gmail.com>
References: <11bc2bb7-ecb5-3ad0-b39f-df632734cd81@discourse.org>
	<CA+hUKGLt7zoFcJemmXzL=ZB3Rdse6Ds_Mm05G5Ogai_yZRp2=A@mail.gmail.com>
	<CA+hUKGLgb4ZMV6xQrZb8N5ax0g+EZR=b0dtg9pPJmsBtaun1-A@mail.gmail.com>
	<2255953.1615421770@sss.pgh.pa.us>
	<CA+hUKGJ6bpG1ghgZccJ57fpyZRHNu2xJkWRmaEP4TEBuXutS-Q@mail.gmail.com>

Thomas Munro <thomas.munro@gmail.com> writes:
> On Thu, Mar 11, 2021 at 1:16 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I'm a little skeptical about the "simple" part.  At minimum, you'd
>> have to syncfs() each tablespace, since we have no easy way to tell
>> which of them are on different filesystems.  (Although, if we're
>> presuming this is Linux-only, we might be able to tell with some
>> unportable check or other.)

> Right, the patch knows about that:

I noticed that the syncfs man page present in RHEL8 seemed a little
squishy on the critical question of error reporting.  It promises
that syncfs will wait for I/O completion, but it doesn't say in so
many words that I/O errors will be reported (and the list of
applicable errno codes is only EBADF, not very reassuring).

Trolling the net, I found a newer-looking version of the man page,
and behold it says

       In mainline kernel versions prior to 5.8, syncfs() will fail only
       when passed a bad file descriptor (EBADF).  Since Linux 5.8,
       syncfs() will also report an error if one or more inodes failed
       to be written back since the last syncfs() call.

So this means that in less-than-bleeding-edge kernels, syncfs can
only be regarded as a dangerous toy.  If we expose an option to use
it, there had better be large blinking warnings in the docs.

			regards, tom lane





view thread (49+ messages)  latest in thread

Message-ID: <2258680.1615425905@sss.pgh.pa.us>
Permalink:  ../2258680.1615425905@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2258680.1615425905@sss.pgh.pa.us

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, thomas.munro@gmail.com, michael.brown@discourse.org
  Subject: Re: fdatasync performance problem with large number of DB files
  In-Reply-To: <2258680.1615425905@sss.pgh.pa.us>
  References: <11bc2bb7-ecb5-3ad0-b39f-df632734cd81@discourse.org> <CA+hUKGLt7zoFcJemmXzL=ZB3Rdse6Ds_Mm05G5Ogai_yZRp2=A@mail.gmail.com> <CA+hUKGLgb4ZMV6xQrZb8N5ax0g+EZR=b0dtg9pPJmsBtaun1-A@mail.gmail.com> <2255953.1615421770@sss.pgh.pa.us> <CA+hUKGJ6bpG1ghgZccJ57fpyZRHNu2xJkWRmaEP4TEBuXutS-Q@mail.gmail.com> <2258680.1615425905@sss.pgh.pa.us>

* 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