From: Thomas Munro <tmunro@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix old-fd issues using global barriers everywhere.
Date: Sat, 07 May 2022 04:52:28 +0000
Message-ID: <E1nnCQd-000NTN-IX@gemulon.postgresql.org> (raw)
Fix old-fd issues using global barriers everywhere.
Commits 4eb21763 and b74e94dc introduced a way to force every backend to
close all relation files, to fix an ancient Windows-only bug.
This commit extends that behavior to all operating systems and adds
a couple of extra barrier points, to fix a totally different class of
bug: the reuse of relfilenodes in scenarios that have no other kind of
cache invalidation to prevent file descriptor mix-ups.
In all releases, data corruption could occur when you moved a database
to another tablespace and then back again. Despite that, no back-patch
for now as the infrastructure required is too new and invasive. In
master only, since commit aa010514, it could also happen when using
CREATE DATABASE with a user-supplied OID or via pg_upgrade.
Author: Andres Freund <andres@anarazel.de>
Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Reviewed-by: Thomas Munro <thomas.munro@gmail.com>
Discussion: https://postgr.es/m/20220209220004.kb3dgtn2x2k2gtdm%40alap3.anarazel.de
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/e2f65f42555ff531c6d7c8f151526b4ef7c016f8
Modified Files
--------------
src/backend/commands/dbcommands.c | 9 +-
src/backend/commands/tablespace.c | 11 +-
src/include/pg_config_manual.h | 11 --
src/test/recovery/Makefile | 2 +-
src/test/recovery/t/032_relfilenode_reuse.pl | 233 +++++++++++++++++++++++++++
5 files changed, 241 insertions(+), 25 deletions(-)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tmunro@postgresql.org
Subject: Re: pgsql: Fix old-fd issues using global barriers everywhere.
In-Reply-To: <E1nnCQd-000NTN-IX@gemulon.postgresql.org>
References: <E1nnCQd-000NTN-IX@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