pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Allow concurrent-safe open() and fopen() in frontend code for Wi
Date: Fri, 14 Sep 2018 01:05:47 +0000
Message-ID: <E1g0cYN-0003oE-IE@gemulon.postgresql.org> (raw)

Allow concurrent-safe open() and fopen() in frontend code for Windows

PostgreSQL uses a custom wrapper for open() and fopen() which is
concurrent-safe, allowing multiple processes to open and work on the
same file.  This has a couple of advantages:
- pg_test_fsync does not handle O_DSYNC correctly otherwise, leading to
false claims that disks are unsafe.
- TAP tests can run into race conditions when a postmaster and pg_ctl
open postmaster.pid, fixing some random failures in the buildfam.

pg_upgrade is one frontend tool using workarounds to bypass file locking
issues with the log files it generates, however the interactions with
pg_ctl are proving to be tedious to get rid of, so this is left for
later.

Author: Laurenz Albe
Reviewed-by: Michael Paquier, Kuntal Ghosh
Discussion: https://postgr.es/m/1527846213.2475.31.camel@cybertec.at
Discussion: https://postgr.es/m/16922.1520722108@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0ba06e0bfb8cfd24ff17aca92aa72245ddd6c4d7

Modified Files
--------------
src/bin/initdb/initdb.c                           | 8 ++++++++
src/bin/pg_basebackup/pg_receivewal.c             | 2 +-
src/bin/pg_verify_checksums/pg_verify_checksums.c | 2 +-
src/common/file_utils.c                           | 4 ++--
src/include/port.h                                | 3 ---
5 files changed, 12 insertions(+), 7 deletions(-)



view thread (24+ messages)  latest in thread

Message-ID: <E1g0cYN-0003oE-IE@gemulon.postgresql.org>
Permalink:  ../E1g0cYN-0003oE-IE@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1g0cYN-0003oE-IE@gemulon.postgresql.org

 · 

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-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Allow concurrent-safe open() and fopen() in frontend code for Wi
  In-Reply-To: <E1g0cYN-0003oE-IE@gemulon.postgresql.org>

* 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