From: Thomas Munro <tmunro@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Rethink PROCSIGNAL_BARRIER_SMGRRELEASE.
Date: Sat, 07 May 2022 04:52:28 +0000
Message-ID: <E1nnCQd-000NTM-I7@gemulon.postgresql.org> (raw)
Rethink PROCSIGNAL_BARRIER_SMGRRELEASE.
With sufficiently bad luck, it was possible for IssuePendingWritebacks()
to reopen a file after we'd processed PROCSIGNAL_BARRIER_SMGRRELEASE and
before the file was unlinked by some other backend. That left a small
hole in commit 4eb21763's plan to fix all spurious errors from DROP
TABLESPACE and similar on Windows.
Fix by closing md.c's segments, instead of just closing fd.c's
descriptors, and then teaching smgrwriteback() not to open files that
aren't already open.
Reported-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Discussion: https://postgr.es/m/20220209220004.kb3dgtn2x2k2gtdm%40alap3.anarazel.de
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/b74e94dc27fdbb13954f230b1d1298430afa6c0c
Modified Files
--------------
src/backend/storage/smgr/md.c | 22 +++++++++++---------
src/backend/storage/smgr/smgr.c | 45 +++++++++++++++++++++++++++++++++--------
src/include/storage/md.h | 1 -
src/include/storage/smgr.h | 2 ++
4 files changed, 52 insertions(+), 18 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: Rethink PROCSIGNAL_BARRIER_SMGRRELEASE.
In-Reply-To: <E1nnCQd-000NTM-I7@gemulon.postgresql.org>
References: <E1nnCQd-000NTM-I7@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