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 1qQMmh-00DfQg-0R for pgsql-hackers@arkaria.postgresql.org; Mon, 31 Jul 2023 06:53:38 +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 1qQMmf-00CPSF-79 for pgsql-hackers@arkaria.postgresql.org; Mon, 31 Jul 2023 06:53:37 +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.94.2) (envelope-from ) id 1qQMme-00CPS6-Tl for pgsql-hackers@lists.postgresql.org; Mon, 31 Jul 2023 06:53:36 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qQMmZ-002WFr-Ro for pgsql-hackers@lists.postgresql.org; Mon, 31 Jul 2023 06:53:35 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTPA id 2DAD360416; Mon, 31 Jul 2023 15:53:27 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.8 at oss.nttdata.com MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 31 Jul 2023 15:53:27 +0900 From: Masahiro Ikeda To: Michael Paquier Cc: Bharath Rupireddy , Tristan Partin , andres@anarazel.de, pgsql-hackers@lists.postgresql.org Subject: Re: Support to define custom wait events for extensions In-Reply-To: References: <97449ae1a3b2189934890f6d78b18216@oss.nttdata.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <446d286f3272437df705ee69ad0d8793@oss.nttdata.com> X-Sender: ikedamsh@oss.nttdata.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2023-07-31 10:10, Michael Paquier wrote: > Attached is a new version. Thanks for all the improvements. I have some comments for v10. (1) - Extensions can add LWLock types to the list shown in - . In some cases, the name + Extensions can add Extension and + LWLock types + to the list shown in and + . In some cases, the name assigned by an extension will not be available in all server processes; - so an LWLock wait event might be reported as - just extension rather than the + so an LWLock or Extension wait + event might be reported as just + extension rather than the extension-assigned name. I think the order in which they are mentioned should be matched. I mean that - so an LWLock or Extension wait + so an Extension or LWLock wait (2) /* This should only be called for user-defined wait event. */ if (eventId < NUM_BUILTIN_WAIT_EVENT_EXTENSION) ereport(ERROR, errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("invalid wait event ID %u", eventId)); I was just wondering if it should also check the eventId that has been allocated though it needs to take the spinlock and GetWaitEventExtensionIdentifier() doesn't take it into account. Regards, -- Masahiro Ikeda NTT DATA CORPORATION