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.94.2) (envelope-from ) id 1qPZqU-00BRRM-I2 for pgsql-hackers@arkaria.postgresql.org; Sat, 29 Jul 2023 02:38:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qPZqS-002wPO-LM for pgsql-hackers@arkaria.postgresql.org; Sat, 29 Jul 2023 02:38:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qPZqR-002wPG-6Q for pgsql-hackers@lists.postgresql.org; Sat, 29 Jul 2023 02:38:16 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qPZqN-000zTr-Nu for pgsql-hackers@lists.postgresql.org; Sat, 29 Jul 2023 02:38:14 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id E45F65C0083; Fri, 28 Jul 2023 22:38:09 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 28 Jul 2023 22:38:09 -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:sender :subject:subject:to:to; s=fm3; t=1690598289; x=1690684689; bh=Sy YlIjDTmv1FfbBhv9SSMc8HIc+ZbAEQVoWO4sPnxGQ=; b=sNhu9GqnlVU3YBIo5Z SDH+4AfuoM5Zr9vrEeiVD1ugzZrf7Iitwf8NRxyaJ88WuVCtubY03Xg5hBN5jBZv 0Og8yhsnEiqLc4LkQLl8LYw/Br/J5salUxuHv7jlESH+F/Kvt3ucmIyrV+tBhSui RHG1qeku0QPYpHFk6pbXpzZtvIsNfImOpNYNeEKMF2wtYAO70ThdF4mJPBvyfApK xx4xcbE45DpQNM2lHJH++wNYVtB4sVTwBwYvrty3VDkWgQJWzwxM19RDtKnVcJuE vWY4uusLCkaoPfIxhZ4Ytfd26qyDx11uUWMrdms+dKtLc+TuKZ+7SaquCtykLt7K fmUA== 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:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1690598289; x=1690684689; bh=SyYlIjDTmv1Ff bBhv9SSMc8HIc+ZbAEQVoWO4sPnxGQ=; b=1avLVGiBQ2qomjElRiW4RmEt4GMbR z73M1Mzm8gdJjoP3m42GgiwW3vhcn3xBvK+qQ+AhVQ+aBnVsjbZ7PXAzbtkoRiJD g7DtbAT93WYd5mnb2Zb9aHpeBqFQ3z+93hB/VMrC7O2Mgk7B/u4/gGU7wqqKfxKs bBcnaW7k5q1fk7tfDi+qpaiAIVcgDYhEsmnoPTlVJ2PQHUdFlJ9mrwNJOpG1eMA0 yRXZfQr84wN/iPZ7Vqn1QneZdtT++uowGQ1EzpTqrSY0OhlBSp66lCpbhhPfTScl SrOopu5YrP8GCUuBSmffw5WH37Y58syt7wCNKq1Qof1A56skPHCKjWDyw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrieejgdeitdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeg geffhfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 28 Jul 2023 22:38:05 -0400 (EDT) Date: Sat, 29 Jul 2023 11:38:00 +0900 From: Michael Paquier To: Andres Freund Cc: Bharath Rupireddy , Masahiro Ikeda , pgsql-hackers@lists.postgresql.org Subject: Re: Support worker_spi to execute the function dynamically. Message-ID: References: <20230728022332.egqzobhskmlf6ntr@awork3.anarazel.de> <20230728203415.m6sw4ulpfnixtfin@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="VlOfv3oagQo9dL7X" Content-Disposition: inline In-Reply-To: <20230728203415.m6sw4ulpfnixtfin@awork3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --VlOfv3oagQo9dL7X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 28, 2023 at 01:34:15PM -0700, Andres Freund wrote: > On 2023-07-28 13:45:29 +0900, Michael Paquier wrote: >> Having each bgworker on its own schema would be enough to prevent >> conflicts, but I'd like to add a second thing: a check on >> pg_stat_activity.wait_event after starting the workers. I have added >> something like that in the patch I have posted today for the custom >> wait events at [1] and it enforces the startup sequences of the >> workers in a stricter way. >=20 > Is that very meaningful? ISTM the interesting thing to check for would be= that > the state is idle? That's interesting for the sake of the other patch to check that the custom events are reported. Anyway, I am a bit short in time, so I have applied the simplest fix where the dynamic workers just use a different base ID to get out of your way. -- Michael --VlOfv3oagQo9dL7X Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmTEe4gACgkQnvQgOdby QH3nExAAoq9cUOOI/rqTuaLQdDMB+S5bzvneI4C/Sb3nDjkY/C7OwxCOg7rWoQgQ woEywPuwRmOFAP7CdnHhEsLpjosPqzliuMPoq/L7U6jkpYWhmJ44cnzW8Zctk7bY QqZJOrzLQ+oT6dJgwvqTWXan29qAoF9oEf0RWQrz6+n9fPnBtlpQHyjQQlXNdxbn EinfeoWcY951J1+OZZxH7OM5nLe8vc2EouwO5JkIEvWpQIS1IhbrTE4RjOWawKNy kwlGvajsIAxI3O5aicLosglZYu1iNNSiINk3kxlREiwb5+pvDb9F0UBcD2X3XGXt 9M3bDMv28YgK9BsdFFNobD2x4Dss1epzzICMTdKHiOTD/tig2T5p5YcplBfMnvWM rJafuw3Dl+3pSOccBVoubch29ZFb1gLWvahNMl1jRmCP4FDJhD0NxFDxAXKs8SZ+ nXAWFdQOEpqtTkqFIuUUpsEaX291fTFL1maeUad94K9tf+/zv34xt8y1ZAEHb5Rq eOregTOI/nlR4shObkbLgtiKNpDfQG+Gjiz+wwJUWUg7no7hq/LH/MJFBUCgNZfJ s0Bfx0wt6qV7e2Yq7ST1TIUnQhHeAxFY+swmEbu6cdWJuRzP50nQnSFnaiQHS63T ma2A6IAi1aY3P3x2Xb8fWkN3DG10o7s2FmUYFABDXRkcC1JfcnI= =uxsq -----END PGP SIGNATURE----- --VlOfv3oagQo9dL7X--