From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Revert refactoring of restore command code to shell_restore.c
Date: Sun, 05 Feb 2023 23:35:39 +0000
Message-ID: <E1pOoXq-001mLS-A4@gemulon.postgresql.org> (raw)
Revert refactoring of restore command code to shell_restore.c
This reverts commits 24c35ec and 57169ad. PreRestoreCommand() and
PostRestoreCommand() need to be put closer to the system() call calling
a restore_command, as they enable in_restore_command for the startup
process which would in turn trigger an immediate proc_exit() in the
SIGTERM handler. Perhaps we could get rid of this behavior entirely,
but 24c35ec has made the window where the flag is enabled much larger
than it was, and any Postgres-like actions (palloc, etc.) taken by code
paths while the flag is enabled could lead to more severe issues in the
shutdown processing.
Note that curculio has showed that there are much more problems in this
area, unrelated to this change, actually, hence the issues related to
that had better be addressed first. Keeping the code of HEAD in line
with the stable branches should make that a bit easier.
Per discussion with Andres Freund and Nathan Bossart.
Discussion: https://postgr.es/m/Y979NR3U5VnWrTwB@paquier.xyz
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/2f6e15ac93c58c1140e4a4affe61e78f7346497a
Modified Files
--------------
src/backend/access/transam/Makefile | 1 -
src/backend/access/transam/meson.build | 1 -
src/backend/access/transam/shell_restore.c | 171 -----------------------------
src/backend/access/transam/xlog.c | 37 ++-----
src/backend/access/transam/xlogarchive.c | 121 +++++++++++++++++++-
src/common/Makefile | 1 +
src/common/archive.c | 60 ++++++++++
src/common/meson.build | 1 +
src/fe_utils/archive.c | 11 +-
src/include/access/xlogarchive.h | 7 +-
src/include/common/archive.h | 21 ++++
src/tools/msvc/Mkvcbuild.pm | 2 +-
12 files changed, 215 insertions(+), 219 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: michael@paquier.xyz
Subject: Re: pgsql: Revert refactoring of restore command code to shell_restore.c
In-Reply-To: <E1pOoXq-001mLS-A4@gemulon.postgresql.org>
References: <E1pOoXq-001mLS-A4@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