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 1qW8iQ-002Fh1-2G for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Aug 2023 05:05:06 +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 1qW8iN-00385J-Vh for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Aug 2023 05:05:04 +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 1qW8iN-003856-9S for pgsql-hackers@lists.postgresql.org; Wed, 16 Aug 2023 05:05:03 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qW8iG-000NuN-1q for pgsql-hackers@lists.postgresql.org; Wed, 16 Aug 2023 05:05:01 +0000 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-31771bb4869so5619842f8f.0 for ; Tue, 15 Aug 2023 22:04:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692162294; x=1692767094; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=gJZX6Q5/N5QBwcgaqIEofvSd0qR2rhbn+aYJScXTS+0=; b=leNxsKXQb6qMXqDdgBwRq9m3571PotOqjfFIqNxbknqc7MmViRJCAgzv6x6O3Oi2SA TpkeSvQJNLcOq3csAbD3PbqDPbiDxtjKVVMn/yWDFMx42nkXF9RpjXFfaR/TPQbime3Q 4SHmuI6kM9CmLnBrghNtBBkTLnKTqHkpQriroHj/cSRRNtXGEMGzCBG50LCC10s2oKiL UbBhljSP+kZWOTxEqqedzkpN8wMQrh47KeBw7Cd0E4mY6Nod39vxAm3L7vFHUNwUBIKl G9iQwP6QBLPtyhOddf+i6EZfsvOkfOh0+VPUp40jlpy7Mqt7SXqZeTW8PyOXwhn+qszw P2eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692162294; x=1692767094; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gJZX6Q5/N5QBwcgaqIEofvSd0qR2rhbn+aYJScXTS+0=; b=krvnV8JTPv9IZRUEKA+oTSIRGudlEfq9An5Z3qVELs3yRzMxjMHc4N0vSMqRHqTMeF +KL2aNlUyFQdMr4i6MQVxG01+g27lIdPGUTGuaavsVCNTSI8hK1v5C1IfGiftsWaQbOg l/KMB2KIpHAbTS/8jNprFFbnSlbDevF+UPTYwxFVs61ozTZym1ae5aBwo1ALvMw2vmxU AClF0CG6Ti4Q+mPabPQUlmwumQDCgbA3TihRYBrRqgJepCRSVdcGnwngVpPdYp+U/mBh pUf6ZGSLG6wpyieA/oqC/a/1TqZKmMcvztefYbxbQlYoZ7UnYrBke2q1KZmTGAbYE6hD MvHQ== X-Gm-Message-State: AOJu0Yze0ZkILyzDndKk4/Eu5WDF2GSZDWgXXzL0dDSWlPfG5Uhtl3Cx B51mvef0w58oMphQ57hwbbc= X-Google-Smtp-Source: AGHT+IElxxRVjpqV+O6+n7iL5Ruom+nUe51/mWZ/5vRG/Z0W5v0EBYpe34ffYxKQfe9hJU6SyZK69g== X-Received: by 2002:a5d:5604:0:b0:313:f4e2:901d with SMTP id l4-20020a5d5604000000b00313f4e2901dmr529978wrv.22.1692162294226; Tue, 15 Aug 2023 22:04:54 -0700 (PDT) Received: from ?IPV6:2a01:cb11:55e:1700:e53d:7d7d:2bca:da2? ([2a01:cb11:55e:1700:e53d:7d7d:2bca:da2]) by smtp.gmail.com with ESMTPSA id k3-20020a056000004300b003177074f830sm19984051wrx.59.2023.08.15.22.04.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Aug 2023 22:04:53 -0700 (PDT) Message-ID: <2f84b397-d020-493c-924c-610b9dd18f8d@gmail.com> Date: Wed, 16 Aug 2023 07:04:53 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: "Drouvot, Bertrand" Subject: Re: WIP: new system catalog pg_wait_event To: Michael Paquier Cc: Kyotaro Horiguchi , tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org References: <3658241.1691161701@sss.pgh.pa.us> <0109438a-9672-322b-7638-04ad47c97d0f@gmail.com> <1dc98591-0d06-f0da-bc88-21f529d6fb8e@gmail.com> <20230808.115332.301701413576096139.horikyota.ntt@gmail.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 8/14/23 6:37 AM, Michael Paquier wrote: > On Thu, Aug 10, 2023 at 08:09:34PM +0200, Drouvot, Bertrand wrote: >> Agree that's worth it given the fact that iterating one more time is not that >> costly here. > > I have reviewed v4, and finished by putting my hands on it to see what > I could do. Thanks! > There are two things > that we could do: > - Hide that behind a macro defined in wait_event_funcs.c. > - Feed the data generated here into a static structure, like: > +static const struct > +{ > + const char *type; > + const char *name; > + const char *description; > +} > > After experimenting with both, I've found the latter a tad cleaner, so > the attached version does that. Yeah, looking at what you've done in v5, I also agree that's better that what has been done in v4 (I also think it will be easier to maintain). > I am not sure that "pg_wait_event" is a good idea for the name if the > new view. How about "pg_wait_events" instead, in plural form? There > is more than one wait event listed. > I'd prefer the singular form. There is a lot of places where it's already used (pg_database, pg_user, pg_namespace...to name a few) and it looks like that using the plural form are exceptions. > One log entry in Solution.pm has missed the addition of a reference to > wait_event_funcs_data.c. > Oh right, thanks for fixing it in v5. > And.. src/backend/Makefile missed two updates for maintainer-clean & co, > no? > Oh right, thanks for fixing it in v5. > One thing that the patch is still missing is the handling of custom > wait events for extensions. Yeah, now that af720b4c50 is done, I'll add the custom wait events handling in v6. > So this still requires more code. I was > thinking about listed these events as: > - Type: "Extension" > - Name: What a module has registered. > - Description: "Custom wait event \"%Name%\" defined by extension". That sounds good to me, I'll do that. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com