Re: should frontend tools use syncfs() ?

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, David Steele <david(at)pgmasters(dot)net>, Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Brown <michael(dot)brown(at)discourse(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: should frontend tools use syncfs() ?
Date: 2023-09-01 01:40:12
Message-ID: ZPFA/HuD/4BGlrK1@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Aug 31, 2023 at 08:48:58AM -0700, Nathan Bossart wrote:
> On Thu, Aug 31, 2023 at 02:30:33PM +0900, Michael Paquier wrote:
> > - Should we have some regression tests? We should only need one test
> > in one of the binaries to be able to stress the new code paths of
> > file_utils.c with syncfs. The cheapest one may be pg_dump with a
> > dump in directory format? Note that we have tests there that depend
> > on lz4 or gzip existing, which are conditional.
>
> I added one for initdb in v8.

+my $supports_syncfs = check_pg_config("#define HAVE_SYNCFS 1");

That should be OK this way. The extra running time is not really
visible, right?

+command_ok([ 'initdb', '-S', $datadir, '--sync-method', 'fsync' ],
+ 'sync method fsync');

Removing this one may be fine, actually, because we test the sync
paths on other places like pg_dump.

> Ha, I was just thinking about this, too. I actually split it into 3
> patches. The first adds DataDirSyncMethod and uses it for
> recovery_init_sync_method. The second adds syncfs() support in
> file_utils.c. And the third adds the ability to specify syncfs in the
> frontend utilities. WDYT?

This split is OK by me, so WFM.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chapman Flack 2023-09-01 01:41:40 Re: More new SQL/JSON item methods
Previous Message Peter Geoghegan 2023-09-01 01:25:05 Re: Eliminate redundant tuple visibility check in vacuum