pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Justin Pryzby <pryzby@telsasoft.com>
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: 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: Mon, 21 Aug 2023 18:44:07 -0700
Message-ID: <20230822014407.GA449131@nathanxps13> (raw)
In-Reply-To: <ZOP5qoUualu5xl2Z@paquier.xyz>
References: <20230729214010.GA189456@nathanxps13>
	<20230731175138.GA432880@nathanxps13>
	<20230731183946.GB537853@nathanxps13>
	<20230801163707.GA862840@nathanxps13>
	<20230808200606.GA1384393@nathanxps13>
	<ZNwF0u/89JFUOQiM@paquier.xyz>
	<20230816151705.GB2651383@nathanxps13>
	<ZN2ZB4afQ2JbR9TA@paquier.xyz>
	<20230818160111.GA189711@nathanxps13>
	<ZOP5qoUualu5xl2Z@paquier.xyz>

On Tue, Aug 22, 2023 at 08:56:26AM +0900, Michael Paquier wrote:
> --- a/src/include/storage/fd.h
> +++ b/src/include/storage/fd.h
> @@ -43,15 +43,11 @@
>  #ifndef FD_H
>  #define FD_H
>  
> +#ifndef FRONTEND
> +
>  #include <dirent.h>
>  #include <fcntl.h>
>  
> Ugh.  So you need this part because pg_rewind's filemap.c includes
> fd.h, and pg_rewind also needs file_utils.h.  This is not the fault of
> your patch, but this does not make the situation better, either..  It
> looks like we need to think harder about this layer.  An improvement
> would be to split file_utils.c so as its frontend-only code is moved
> to OBJS_FRONTEND in a new file with a new header?  It should be OK to
> keep DataDirSyncMethod in file_utils.h as long as the split is clean.

I'm hoping there's a simpler path forward here.  pg_rewind only needs the
following lines from fd.h:

	/* Filename components */
	#define PG_TEMP_FILES_DIR "pgsql_tmp"
	#define PG_TEMP_FILE_PREFIX "pgsql_tmp"

Maybe we could move these to file_utils.h instead.  WDYT?

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





view thread (50+ messages)  latest in thread

Message-ID: <20230822014407.GA449131@nathanxps13>
Permalink:  ../20230822014407.GA449131@nathanxps13/
Also on:    postgresql.org/message-id/20230822014407.GA449131@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, michael@paquier.xyz, pryzby@telsasoft.com, thomas.munro@gmail.com, david@pgmasters.net, masao.fujii@oss.nttdata.com, bruce@momjian.us, tgl@sss.pgh.pa.us, michael.brown@discourse.org
  Subject: Re: should frontend tools use syncfs() ?
  In-Reply-To: <20230822014407.GA449131@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