Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xT3VC-000000004On-0glw for pgsql-bugs@arkaria.postgresql.org; Mon, 16 Nov 2026 20:40:34 +0000 Received: from localhost ([127.0.0.1]:50786 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xT3VB-00000001ESU-2bZm for pgsql-bugs@arkaria.postgresql.org; Mon, 16 Nov 2026 20:40:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]:45476) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xT3VB-00000001ESL-1XOr for pgsql-bugs@lists.postgresql.org; Mon, 16 Nov 2026 20:40:33 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xT3V9-000000003Ca-0kxD for pgsql-bugs@lists.postgresql.org; Mon, 16 Nov 2026 20:40:33 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 6AGKeSA3145932; Mon, 16 Nov 2026 15:40:28 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 sss.pgh.pa.us 6AGKeSA3145932 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sss.pgh.pa.us; s=default; t=1794861628; bh=aIMNPmaZmL9LqB1iSCmZjbgfiQZtGT6vrBmMiIsJFZM=; h=From:To:cc:Subject:In-reply-to:References:Date:From; b=dyArrd54pNzMpADgWwLqt0YyT4xkQONhE/aWLFRu7VmTVXAMPHX3mwH0fF3nphx7p vLi9eVzo06kLdCZ9DpDzRSgPWO7qMba0Dac5ufkKXa9/Kpt4Vp/V/MgZYFaGHTOJia tea5utSFm9oFGGuhFzPOBfgOg8Cai3KpAtWe992s= From: Tom Lane To: Robert Haas cc: schefner20@gmail.com, 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 In-reply-to: References: <19908-3db6f3c4f2febdcf@postgresql.org> Comments: In-reply-to Robert Haas message dated "Mon, 16 Nov 2026 15:16:46 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <145930.1794861628.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Mon, 16 Nov 2026 15:40:28 -0500 Message-ID: <145931.1794861628@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Haas writes: > On Mon, Nov 16, 2026 at 10:55 AM PG Bug reporting form > 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