pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Thomas Munro <thomas.munro@gmail.com>
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@postgresql.org
Subject: Re: should frontend tools use syncfs() ?
Date: Fri, 1 Sep 2023 11:08:51 -0700
Message-ID: <20230901180851.GC3180181@nathanxps13> (raw)
In-Reply-To: <ZPImMi8smaPsXjGK@pryzbyj2023>
References: <20210930004340.GM831@telsasoft.com>
	<YVUz0Ay9KshniWBe@paquier.xyz>
	<20220413115412.GM26620@telsasoft.com>
	<20230729214010.GA189456@nathanxps13>
	<ZPImMi8smaPsXjGK@pryzbyj2023>

Thanks for taking a look.

On Fri, Sep 01, 2023 at 12:58:10PM -0500, Justin Pryzby wrote:
>> +	if (!user_opts.sync_method)
>> +		user_opts.sync_method = pg_strdup("fsync");
> 
> why pstrdup?

I believe I was just following the precedent set by some of the other
options.

>> +parse_sync_method(const char *optarg, SyncMethod *sync_method)
>> +{
>> +	if (strcmp(optarg, "fsync") == 0)
>> +		*sync_method = SYNC_METHOD_FSYNC;
>> +#ifdef HAVE_SYNCFS
>> +	else if (strcmp(optarg, "syncfs") == 0)
>> +		*sync_method = SYNC_METHOD_SYNCFS;
>> +#endif
>> +	else
>> +	{
>> +		pg_log_error("unrecognized sync method: %s", optarg);
>> +		return false;
>> +	}
> 
> This should probably give a distinct error when syncfs is not supported
> than when it's truely recognized.

Later versions of the patch should have this.

> The patch should handle pg_dumpall, too.

It looks like pg_dumpall only ever fsyncs a single file, so I don't think
it is really needed there.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com





view thread (50+ messages)  latest in thread

Message-ID: <20230901180851.GC3180181@nathanxps13>
Permalink:  ../20230901180851.GC3180181@nathanxps13/
Also on:    postgresql.org/message-id/20230901180851.GC3180181@nathanxps13

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: nathandbossart@gmail.com, pryzby@telsasoft.com, michael@paquier.xyz, thomas.munro@gmail.com, 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: <20230901180851.GC3180181@nathanxps13>

* 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