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 1w7Wk7-005PRf-2O for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Mar 2026 10:54:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w7Wk4-009fIv-33 for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Mar 2026 10:54:41 +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 1w7Wk4-009fIm-26 for pgsql-hackers@lists.postgresql.org; Tue, 31 Mar 2026 10:54:41 +0000 Received: from fout-b2-smtp.messagingengine.com ([202.12.124.145]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w7Wk2-00000001xHe-4ASK for pgsql-hackers@postgresql.org; Tue, 31 Mar 2026 10:54:40 +0000 Received: from phl-compute-11.internal (phl-compute-11.internal [10.202.2.51]) by mailfout.stl.internal (Postfix) with ESMTP id 078591D0025E; Tue, 31 Mar 2026 06:54:38 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Tue, 31 Mar 2026 06:54:38 -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=1774954477; x=1775040877; bh=fnZ9lCsBZg Yqod1mwUTv104Vei9QWXbVhxSSXkdv3bE=; b=dLRIkotrkOjCeUpgX6vLuzXIrH 9L6p0H0tqNUe+ZTUcysBWB9xxiQ5XYkyQJeUL86EaGKI5xSDksHObCmwekqnlG+F XcadQhaAuMxEK1V51ABPOBhxLm4fx3upq9VH+HBaYuGE+LsqR0DmNAwY2dICXPx5 PQdfLr+3poULJm7qeJbLrQQgmFyRy+X+PpSuohNvGTVR60vwaeiAJY23lzSrI1gY 7y14TRCMjyQgfUdBhN6XHhTKtw+PgV0PJ3Md7a20cW7RdkGGFpF8z2WL4KkA5W2r gXJ5GChmvrpTNjsT1wxyaK27PQRQk6QhQUQvUcIZP/ZAash4v8K2dU13yiSw== 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= 1774954477; x=1775040877; bh=fnZ9lCsBZgYqod1mwUTv104Vei9QWXbVhxS SXkdv3bE=; b=AFSzj8VxgnQE9GcyArE9sJyTN38oIYchGYIt7Q724WDQtzAcFkZ pe0TOj+3an2Ho+wRWIv3Y38H7Vg5d6+f+8+JejixWbkm0P9MBIV+whme9ER0V1UA Tst9tGODOjcKgkkMUoYE6IOZUVS7bInWLo63/1KQp9vCA8DokdiKSMXT1LYKZV98 Z1eerCBzCH58vfDrz2ExIYC7Sx6EYq4QiqgNgQQzv1EVDUd2g3QN36BQZPIxlgpS BGvNJ/TKxQ/PBsltfGHSM7vWG1eSXBbJd3D8ANwPQSlG0IydmOFz6F2Er61zo88N LWdmJrrhVl8N3ux00Ao2gKp2RlN6AOK42Qg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgddtudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegrihhl ohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvf fnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfh rhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquhhivg hrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeggeffhfek ueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiipdhnsggp rhgtphhtthhopeekpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegvgigtlhhush hiohhnsehgmhgrihhlrdgtohhmpdhrtghpthhtohepthhglhesshhsshdrphhghhdrphgr rdhushdprhgtphhtthhopehifigrthgrrdgrhigrsehfuhhjihhtshhurdgtohhmpdhrtg hpthhtohepshhmihhthhhpsgdvvdehtdesghhmrghilhdrtghomhdprhgtphhtthhopehk uhhrohgurgdrhhgrhigrthhosehfuhhjihhtshhurdgtohhmpdhrtghpthhtohepphgrvh gvlhdrshhtvghhuhhlvgesghhmrghilhdrtghomhdprhgtphhtthhopehlihdrvghvrghn rdgthhgrohesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrh hssehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 31 Mar 2026 06:54:34 -0400 (EDT) Date: Tue, 31 Mar 2026 19:54:30 +0900 From: Michael Paquier To: Alexander Lakhin Cc: Tom Lane , =?utf-8?B?SXdhdGEsIEF5YS/lsqnnlLAg5b2p?= , Peter Smith , =?utf-8?B?S3Vyb2RhLCBIYXlhdG8v6buS55SwIOmavOS6ug==?= , Pavel Stehule , Chao Li , pgsql-hackers Subject: Re: [PROPOSAL] Termination of Background Workers for ALTER/DROP DATABASE Message-ID: References: <1020519.1773863522@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="jPMVoGP2rrFFaQyi" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --jPMVoGP2rrFFaQyi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Mar 31, 2026 at 10:00:00AM +0300, Alexander Lakhin wrote: > So the backend is not completely stuck, but CommitTransactionCommand() > may take more than 5 seconds under some circumstances (maybe it's worth > investigating which exactly). One could blame slow hardware, difficult to say, and I'm puzzled by these periodic bumps that don't seem to happen elsewhere. There is at least one alternative that I can think here to make the test more stable and make sure that worker_spi reaches its main loop before attempting the database commands. We could add a wait_for_event() at the end of launch_bgworker() based on WorkerSpiMain, and enlarge worker_spi_naptime to an insanely larger value, to make sure that we remain on the WaitLatch() until the worker is interrupted and that we don't attempt a new transaction. -- Michael --jPMVoGP2rrFFaQyi Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmnLp+YACgkQnvQgOdby QH2SjA//eH9PkXie7At8ycQ3ZpQq+LaI6p2O3GB7YrejrJND6rk+dGU49gb4FFYL HaoY9MRPC17R+N+G25oQp95Om0uxX1LbsALm+WWjmKjbwRLVwosDrC4MZZBDp4Lv l7Tj2pShl9ZGKc3KV8M+EKTRARHdA+MujMO0rWs9XdR1+UHvCr4nEvseV0BthLah Zzt+WpEQdoF13zj21GaHhsC15xdv20VdtBaoaLCrizyJu+T6Lf/MwugUmvQ2UvL/ /pQE4Ar6jci4eyE8Y7p+S7TL+w3IVFPYTXYTyw+fZDpkig4cFoDg1Upfsu0MoaBG zE6eC5lSlfEzEFI+ulKjkPTdeKnF/h8VwrfClOJG/gK7IDC2BrmanGCxvTCLO+Az mTVSe/S6shaLgFVvG7YoRSB3+gFSc78JbS70/t2bcRBPsq1JIrameaRc4/urw2nW 5wAfo0Lvy5lp0QGnD5KFJMabcR3UvtCU+wW44vDNgikqXpsg/isrMT6RD7fuWjcI IKNBh4Dh+9BL89ve88VaI+H9MGaBBbGrPiwQhAZH51ph6i+cXE5F2o5Wz6p21bJ7 hhqDtp/6wfwc1dbGzJiO7FSTm5heAEnI0OVk8biSfLGt+MtNQC0DW5m4JQth5YtU 921chromjmTLquCXBHt0yKido6Wk+nGmwLKBYrI/a9W93QKkcLY= =F4d4 -----END PGP SIGNATURE----- --jPMVoGP2rrFFaQyi--