From: Justin Pryzby <pryzby@telsasoft.com>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: David Steele <david@pgmasters.net>
Cc: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Paul Guo <guopa@vmware.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Michael Brown <michael.brown@discourse.org>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: should frontend tools use syncfs() ?
Date: Sat, 2 Oct 2021 10:41:54 -0500
Message-ID: <20211002154154.GD27491@telsasoft.com> (raw)
In-Reply-To: <CA+hUKGJYChC0witfaTrURsds4Y6cOnCb1-P2UvBvui8pwQhTEA@mail.gmail.com>
References: <20210930004340.GM831@telsasoft.com>
<YVUz0Ay9KshniWBe@paquier.xyz>
<CA+hUKGJYChC0witfaTrURsds4Y6cOnCb1-P2UvBvui8pwQhTEA@mail.gmail.com>
On Thu, Sep 30, 2021 at 05:08:24PM +1300, Thomas Munro wrote:
> On Thu, Sep 30, 2021 at 4:49 PM Michael Paquier <michael@paquier.xyz> wrote:
> > fsync_pgdata() is going to manipulate many inodes anyway, because
> > that's a code path designed to do so. If we know that syncfs() is
> > just going to be better, I'd rather just call it by default if
> > available and not add new switches to all the frontend tools in need
> > of flushing the data folder, switches that are not documented in your
> > patch.
>
> If we want this it should be an option, because it flushes out data
> other than the pgdata dir, and it doesn't report errors on old
> kernels.
I ran into bad performance of initdb --sync-only shortly after adding it to my
db migration script, so added initdb --syncfs.
I found that with sufficiently recent coreutils, I can do what's wanted by calling
/bin/sync -f /datadir
Since it's not integrated into initdb, it's necessary to include each
tablespace and wal.
--
Justin
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: pryzby@telsasoft.com, thomas.munro@gmail.com, michael@paquier.xyz, david@pgmasters.net, masao.fujii@oss.nttdata.com, bruce@momjian.us, guopa@vmware.com, tgl@sss.pgh.pa.us, michael.brown@discourse.org
Subject: Re: should frontend tools use syncfs() ?
In-Reply-To: <20211002154154.GD27491@telsasoft.com>
* 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