pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Masahiro Ikeda <ikedamsh@oss.nttdata.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Support to define custom wait events for extensions
Date: Thu, 13 Jul 2023 10:26:35 +0900
Message-ID: <cb7d5257d1b1a25aa405c219732aaf8c@oss.nttdata.com> (raw)
In-Reply-To: <ZK9BdDI6KMxmiG+5@paquier.xyz>
References: <CTDCV6CIJAKR.TQOTL86K9628@gonk>
	<e4cef41ee00f791c2264f871dc6b5b19@oss.nttdata.com>
	<CTE7JPUIMMBL.2YLT1IWHPUDZ8@gonk>
	<a9eae9af-3834-ceed-33bc-d36c914fef53@oss.nttdata.com>
	<135feae32cd28f9fb555fe46acb939a0@oss.nttdata.com>
	<f3c10c343e6a6080a6b57f0ed25d9e52@oss.nttdata.com>
	<c18393a428412ede7acd2355c27b3c1f@oss.nttdata.com>
	<ZK0IluceH+Hd5h22@paquier.xyz>
	<eaf82a85c0ef1b55dc3b651d3f7b867a@oss.nttdata.com>
	<ZK5oZ6wzVrgk5wuT@paquier.xyz>
	<ZK9BdDI6KMxmiG+5@paquier.xyz>

On 2023-07-13 09:12, Michael Paquier wrote:
> On Wed, Jul 12, 2023 at 05:46:31PM +0900, Michael Paquier wrote:
>> On Wed, Jul 12, 2023 at 04:52:38PM +0900, Masahiro Ikeda wrote:
>>> If the behavior is unexpected, we need to change the current code.
>>> I have created a patch for the areas that I felt needed to be 
>>> changed.
>>> - 0001-change-the-die-condition-in-generate-wait_event_type.patch
>>>  (In addition to the above, "$continue = ",\n";" doesn't appear to be
>>> necessary.)
>> 
>>     die "wait event names must start with 'WAIT_EVENT_'"
>>       if ( $trimmedwaiteventname eq $waiteventenumname
>> -       && $waiteventenumname !~ /^LWLock/
>> -       && $waiteventenumname !~ /^Lock/);
>> -   $continue = ",\n";
>> +       && $waitclassname !~ /^WaitEventLWLock$/
>> +       && $waitclassname !~ /^WaitEventLock$/);
>> 
>> Indeed, this looks wrong as-is.  $waiteventenumname refers to the
>> names of the enum elements, so we could just apply a filter based on
>> the class names in full.  The second check in for the generation of
>> the c/h files uses the class names.
> 
> At the end, I have gone with an event simpler way and removed the
> checks for LWLock and Lock as their hardcoded values marked as DOCONLY
> satisfy this check.  The second check when generating the C and header
> code has also been simplified a bit to use an exact match with the
> class name.

Thanks for your quick response. I'll rebase for the commit.

Regards,
-- 
Masahiro Ikeda
NTT DATA CORPORATION





view thread (78+ messages)  latest in thread

Message-ID: <cb7d5257d1b1a25aa405c219732aaf8c@oss.nttdata.com>
Permalink:  ../cb7d5257d1b1a25aa405c219732aaf8c@oss.nttdata.com/
Also on:    postgresql.org/message-id/cb7d5257d1b1a25aa405c219732aaf8c@oss.nttdata.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: ikedamsh@oss.nttdata.com, michael@paquier.xyz, pgsql-hackers@lists.postgresql.org
  Subject: Re: Support to define custom wait events for extensions
  In-Reply-To: <cb7d5257d1b1a25aa405c219732aaf8c@oss.nttdata.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox