Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qJUl0-0003M5-Nd for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Jul 2023 07:59:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qJUkz-0000JG-6d for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Jul 2023 07:59:29 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qJUky-0000J7-Tn for pgsql-hackers@lists.postgresql.org; Wed, 12 Jul 2023 07:59:28 +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 1qJUkv-003Pkm-Vi for pgsql-hackers@lists.postgresql.org; Wed, 12 Jul 2023 07:59:27 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTPA id 4413B607C2; Wed, 12 Jul 2023 16:59:22 +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: Wed, 12 Jul 2023 16:59:22 +0900 From: Masahiro Ikeda To: Tristan Partin Cc: pgsql-hackers@lists.postgresql.org Subject: Re: Support to define custom wait events for extensions In-Reply-To: References: <135feae32cd28f9fb555fe46acb939a0@oss.nttdata.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: 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-12 02:39, Tristan Partin wrote: >> From bf06b8100cb747031959fe81a2d19baabc4838cf Mon Sep 17 00:00:00 2001 >> From: Masahiro Ikeda >> Date: Fri, 16 Jun 2023 11:53:29 +0900 >> Subject: [PATCH 1/2] Support custom wait events for extensions. > >> + * This is indexed by event ID minus >> NUM_BUILTIN_WAIT_EVENT_EXTENSION, and >> + * stores the names of all dynamically-created event ID known to the >> current >> + * process. Any unused entries in the array will contain NULL. > > The second ID should be plural. Thanks for reviewing. Yes, I'll fix it. >> + /* If necessary, create or enlarge array. */ >> + if (eventId >= ExtensionWaitEventTrancheNamesAllocated) >> + { >> + int newalloc; >> + >> + newalloc = pg_nextpower2_32(Max(8, eventId + 1)); > > Given the context of our last conversation, I assume this code was > copied from somewhere else. Since this is new code, I think it would > make more sense if newalloc was a uint16 or size_t. As Michael-san said, I used LWLockRegisterTranche() as a reference. I think it is a good idea to fix the current master. I'll modify the above code accordingly. > From what I undersatnd, Neon differs from upstream in some way related > to this patch. I am trying to ascertain how that is. I hope to provide > more feedback when I learn more about it. Oh, it was unexpected for me. Thanks for researching the reason. Regards, -- Masahiro Ikeda NTT DATA CORPORATION