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.96) (envelope-from ) id 1wDs4z-003Rfa-0t for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Apr 2026 22:54:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wDs4s-00BWIV-1l for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Apr 2026 22:54:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wDs4r-00BWIL-2F for pgsql-hackers@lists.postgresql.org; Fri, 17 Apr 2026 22:54:22 +0000 Received: from fhigh-a5-smtp.messagingengine.com ([103.168.172.156]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wDs4o-00000001Xb2-2aSf for pgsql-hackers@postgresql.org; Fri, 17 Apr 2026 22:54:20 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id AB25B1400078; Fri, 17 Apr 2026 18:54:17 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Fri, 17 Apr 2026 18:54:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1776466457; x=1776552857; bh=A4RUgBqTfT cu+v9P0+GVKYUir+0vv72eeDJVkU4zR5c=; b=ii/NbjeN8zBZHCuhr2RSkno8el H81DweZhnvkWKfQK2jgOdvlUxz5OoGYHg0cOMQG/pTl/aux6f2rSYNZxcuLVoZLj hsaR3jsnjCO6/UJileFd2Fms1wJoO305iQ92PstH7MG03K9t4kZ3qcYAOVPBFnhb jTFdYN/hUqVhxyz4mWvhvpBBGFsuObI+47D/oJnT6Y5S6JG28NqEHv1y4JLBnMtM OMHDhuy1yNnEIYAIwDUG5cSgkPoAiwY5MD4EO7Ldme/AYG8AN+pzXtGTdL6cULWm 2FB59S/3obzDyiB37aYFabv/go6FlkYUWNp0Voii9ef4Ba1ViKLQ0778l3Ag== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1776466457; x=1776552857; bh=A4RUgBqTfTcu+v9P0+GVKYUir+0vv72eeDJ VkU4zR5c=; b=gGU34Omw22oKhniF+7W4LOEi9T2wAJtfBlIj8XYYz4GDq+EtlLN YU4Fc/hB4E1yFmgjNL2+e36R+q6/2aAsuDhPoMHCcg0iT9+FjlwMDDcNhJEeCoiA cCLRbIUAVz7ZHoz5hGZD+6maMJH506YJvcf7+XCvU7bDo5hcSA0z48wUKyqm9jHl X2SEZunoF/rQA2ridRZBFxJn+bv78HsKA5Xbut4lcjmWLN6nr6cOesvS+h/Xq9lm /f5OLF2gyG5n1XhJX385togkz1mkGSNuvDg5H/ikO5XBAi8TpY1gHOD3Ra0SnXb1 O/pcWqQ2FhYHR/TxUEAMPL6xewbdF0MBC2g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdehuddufecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlh cuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvden ucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquh hivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeggeff hfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiipdhn sggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegrhihush hhthhifigrrhhirdhslhhgtddusehgmhgrihhlrdgtohhmpdhrtghpthhtohephhhlihhn nhgrkhgrsehikhhirdhfihdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehpoh hsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehnohgrhheslhgvrggusghorghtrdgt ohhm X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 17 Apr 2026 18:54:16 -0400 (EDT) Date: Sat, 18 Apr 2026 07:54:14 +0900 From: Michael Paquier To: Ayush Tiwari Cc: Heikki Linnakangas , pgsql-hackers@postgresql.org, "noah@leadboat.com" Subject: Re: [PATCH] postmaster: fix stale PM_STARTUP comment Message-ID: References: <0f462532-9790-4334-b503-4ee522225820@iki.fi> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="9/84afe9OKtbOAfX" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --9/84afe9OKtbOAfX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Apr 17, 2026 at 07:17:18PM +0530, Ayush Tiwari wrote: > I've attached a patch, please review and let me know your thoughts. /* - * Unexpected exit of startup process (including FATAL exit) - * during PM_STARTUP is treated as catastrophic. There are no - * other processes running yet, so we can just exit. - */ - if (pmState == PM_STARTUP && - StartupStatus != STARTUP_SIGNALED && - !EXIT_STATUS_0(exitstatus)) The assumption that only the startup process is running while we are in a PM_STARTUP state is wrong since 7ff23c6d277d, and this exit code path has been missed the fact that now the checkpointer and the bgwriter are started during recovery. So this means a backpatch. Removing the assertion is the right move, yes, there are other children, so again that's an issue with 7ff23c6d277d. I am planning to double-check the shutdown sequence while switching to PM_WAIT_BACKENDS under a PM_STARTUP, just note that bgworkers that use BgWorkerStart_PostmasterStart cannot request a database connection, meaning that PM_WAIT_BACKENDS should be pointeless, but perhaps it makes the whole shutdown flow easier to reason about, as you are suggesting, as making this path more complicated would lead to the addition of more postmaster states. Making this code simpler, not more complicated, is always useful. -- Michael --9/84afe9OKtbOAfX Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmniuhYACgkQnvQgOdby QH1rJQ//V5lkebj5A2y8qSjUIECe+HdobpYrJPo/Qk9p+OkXExw4XawzWrPQwKX1 KaD0ivy0FTussufW10NcJuzPNiFnjykqL32o7pHlcG5KM2W3ZyDXgd7zBpoeYg1d TN/8OwO5ezbOZQnAPpe+Lb0gx5TzzQWWsR5xpN7vyoDjw1FSBgdtRWiUqRmFMNUc 1DtTGZPcG/1iwGWyiBHB5vnEapZGKI5bY+n7sZe9UKPl/GZInQ3BFy2TM/AHjjOw RE8UJOfuxcIKxDN+/487EXx8FYWVBifI7IeluQziaBjSfQAqhZ277Xa/PbXKV3EX 7tCBF2prfYXDSeLzxz6UsBF/T0TkJa+6G2C/GUxmWltzsLjtu8rRLQuUWQMzKJBU 0M+pc7fvZfWK1cxBmu1aLecHeIRl3CbT/JSE4/5UULDhHFi19VaAw/nG05Dm8fnj Nz1X2Rkz5bAAVypgWB2RxFhE7wi0Vfa2kQLE7XeI401XEJ0cU3nAyCcVFr9ntZo4 oxRDjZYGQSIaOl8uxEVM36/R3EGmkKcYaS4BV7rXIXP3a9n9oVd6nUTpi+KruYom d4jCPBoRapeHkYvCi44Nb8sFbMLRL74O9xiitoE4DL6zEajvPw901P2wS4OX/9rV lRuD7DYrjLdBJktUn0QYitbj+oX9bGbc4/xjsnSZtP44KkF8KH0= =aJBb -----END PGP SIGNATURE----- --9/84afe9OKtbOAfX--