From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: schefner20@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19908: pg_upgrade --check crashes instance if running in a different PID Namespace then the old cluster
Date: Mon, 16 Nov 2026 15:40:28 -0500
Message-ID: <145931.1794861628@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoaY4bO5dh8FXjo=Ec3J=gXHZdFgfQY5pWdKAh7wzPejSA@mail.gmail.com>
References: <19908-3db6f3c4f2febdcf@postgresql.org>
<CA+TgmoaY4bO5dh8FXjo=Ec3J=gXHZdFgfQY5pWdKAh7wzPejSA@mail.gmail.com>
Robert Haas <robertmhaas@gmail.com> writes:
> On Mon, Nov 16, 2026 at 10:55 AM PG Bug reporting form
> <noreply@postgresql.org> wrote:
>> Possible Explanation:
>> - pg_upgrade read the postmaster.pid and checked if the PID exists
>> - it then couldn't find a process with that PID because the container,
>> where pg_upgrade was running on, has its own PID namespace
>> - since it can't find the PID, pg_upgrade startet a second instance
> This is unfortunate, but I'm not sure what to do about it. Because the
> servers are running in different PID namespaces, and apparently also
> different IPC namespaces, the usual interlocks don't work, so when
> pg_upgrade tries to start a new postmaster, bad things can happen. The
> obvious answer is to never try to start a new server in --check mode,
> but then --check wouldn't be able to ignore a stale postmaster.pid
> file any more. I'm not sure how important it is for us to be able to
> ignore stale postmaster.pid files is here, but my guess is that some
> people would complain if we didn't.
Yeah, I think skipping this step would be a cure substantially more
dangerous than the disease. Note the comment in
check_clusters_stopped about ensuring that WAL replay is complete.
Moreover, I think making it safe or easy to run PG in this environment
is a bad idea. If you've got namespacing or other stuff that can
inhibit the ability of one would-be postmaster to see another one,
you are playing with fire. You need to not run things that way, or
someday you'll find your data eaten.
regards, tom lane
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-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, schefner20@gmail.com
Subject: Re: BUG #19908: pg_upgrade --check crashes instance if running in a different PID Namespace then the old cluster
In-Reply-To: <145931.1794861628@sss.pgh.pa.us>
References: <19908-3db6f3c4f2febdcf@postgresql.org> <CA+TgmoaY4bO5dh8FXjo=Ec3J=gXHZdFgfQY5pWdKAh7wzPejSA@mail.gmail.com> <145931.1794861628@sss.pgh.pa.us>
* 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