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 1ttvc7-0021cN-Fh for pgsql-bugs@arkaria.postgresql.org; Sun, 16 Mar 2025 21:33:43 +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 1ttvc6-001Qx5-4q for pgsql-bugs@arkaria.postgresql.org; Sun, 16 Mar 2025 21:33:42 +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 1ttvc5-001Qwv-Nl for pgsql-bugs@lists.postgresql.org; Sun, 16 Mar 2025 21:33:41 +0000 Received: from out-02.pe-bsn.jellyfish.systems ([66.29.159.80]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ttvc3-003Co3-07 for pgsql-bugs@lists.postgresql.org; Sun, 16 Mar 2025 21:33:40 +0000 Received: from prod-lbout-phx.jellyfish.systems (bsn-01-5.privateemail.com [198.54.122.103]) by pe-bsn.jellyfish.systems (Postfix) with ESMTPA id 4ZGBDd1tBVz2xVK; Sun, 16 Mar 2025 21:33:37 +0000 (UTC) Received: from MTA-09.privateemail.com (unknown [10.50.14.19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by BSN-01.privateemail.com (Postfix) with ESMTPS id 4ZGBDd1Ddjz3hhTh; Sun, 16 Mar 2025 17:33:37 -0400 (EDT) Received: from mta-09.privateemail.com (localhost [127.0.0.1]) by mta-09.privateemail.com (Postfix) with ESMTP id 4ZGBDd00qgz3hhVC; Sun, 16 Mar 2025 17:33:37 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=viktorh.net; s=default; t=1742160817; bh=ScXQ8yzZrKVZFSnpOs/w15e+pC3uyTXCfdAPPragSn4=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From; b=jGLzvQKvyKvKLXQLDdrvLsP5YdVQ7OIDmYf6iG2BgE2wPsmA2QFwK8DAp24lKMO6A nE2gMot6w6shE86DatUcGBZYVbBlLq/5EBrtlCI1day01obNnhHBCN2hIQalI8JUrt qeMENno+TzelbZrJgdB/BTY5jGujnVSfVWKEBqZMo9ZySbEZUpZ8c/d1DWeOXCm5vE MbmQaTMVQi8iNdQPUn+39Cj0JJPRhFcMJhvF8MfTqyEKtI0ReflQZvVyp/CNjMZbT7 A+yrdL9xdiquzA4Zq/Lxz3hxsHAAmw1BaH8Gi+qafwX64R88DY8qS7PZl2Vvp1mj/y AwQWDL2le0lEg== Received: from [192.168.1.100] (unknown [143.58.148.107]) by mta-09.privateemail.com (Postfix) with ESMTPA; Sun, 16 Mar 2025 17:33:35 -0400 (EDT) Date: Sun, 16 Mar 2025 21:33:21 +0000 From: Viktor Holmberg To: Tom Lane Cc: pgsql-bugs@lists.postgresql.org Message-ID: <13b851cb-20c8-4a5a-9b7e-90b225635edd@Spark> In-Reply-To: <3768914.1742148108@sss.pgh.pa.us> References: <790bc1f9-74dc-4b50-94d2-8147315b1556@Spark> <51C655A4-46FB-4A40-BAE5-26A76B31D3EE@yesql.se> <3052531.1741961784@sss.pgh.pa.us> <3074065.1741965229@sss.pgh.pa.us> <3080651.1741969122@sss.pgh.pa.us> <742add6c-02ac-42e4-97a3-f2ebd1520d64@Spark> <3481904.1742055723@sss.pgh.pa.us> <3768914.1742148108@sss.pgh.pa.us> Subject: Re: ISN extension - wrong volatility level for isn_weak() function X-Readdle-Message-ID: 13b851cb-20c8-4a5a-9b7e-90b225635edd@Spark MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="67d743ac_22221a70_5a54" X-Virus-Scanned: ClamAV using ClamSMTP List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --67d743ac_22221a70_5a54 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Guess I shouldn=E2=80=99t have said it was easy considering all the edits= needed hehe. Thanks a lot for the help, fixes and push Tom=21 Wasn=E2=80=99t expecting= such a lightning turnaround. /Viktor Holmberg On 16 Mar 2025 at 18:02 +0000, Tom Lane , wrote: > Viktor Holmberg writes: > > Oh, sorry=21 Don=E2=80=99t know what I was doing there - not used to = this patch based workflow. Here comes the real patch. > > This now uses the GUC - that was a lot easier than I thought. > > I reviewed this and pushed it with some corrections. Thanks for > the contribution=21 > > Some notes: > > * To make g=5Fweak actually act like a GUC, accept=5Fweak=5Finput() has= > to set it via set=5Fconfig=5Foption() not just overwrite it. Otherwise > it won't roll back on transaction abort, for example. There was also > a missing MarkGUCPrefixReserved() call. Makes sense. I actually thought about calling set=5Fconfig option but dec= ided not fixing it was more backwards compatible. But can=E2=80=99t think of any reason why anyone wouldn=E2=80=99t want it= working like a true GUC. > > * I concluded that the isn=5Fweak() functions ought to be marked like > set=5Fconfig() (VOLATILE and PARALLEL UNSA=46E) and current=5Fsetting()= > (STABLE and PARALLEL SA=46E). It's debatable whether a function that > reacts to a GUC should really be STABLE, since you can surely make its > output change intra-query if you try. However, we pretty consistently > do that elsewhere because of the negative performance implications of > marking all such functions VOLATILE. The previous PARALLEL RESTRICTED > markings were probably okay when g=5Fweak's value couldn't propagate in= to > parallel workers, but they're wrong now. Makes sense > > * You missed updating the module's meson.build file, which is hardly > your fault since I pointed you at an example commit that predated > our Meson support. But nowadays pretty much anything done to a > Makefile has to be reflected in meson.build and vice versa. > > * I editorialized on the docs a bit, mostly to be more like existing > practice in other contrib modules. One point there is that =22GUC=22 > is internal jargon that we prefer to avoid using in user-facing docs. Agree you edits make it more clear. > > All in all though, pretty close for a first contribution. > Thanks again=21 > > regards, tom lane --67d743ac_22221a70_5a54 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Guess I shouldn=E2=80=99t have said it was easy con= sidering all the edits needed hehe.

Thanks a lot for the help, fixes and push Tom=21 Wasn=E2=80=99t expecting= such a lightning turnaround.

/Viktor Holmberg
On 16 Mar 2025 at 18:02 +0000, Tom Lane <tgl=40s= ss.pgh.pa.us>, wrote:
Viktor Holmberg <v=40viktorh.net> writes:
Oh, sorry=21 Don=E2=80=99t know what I was doing there - not used to thi= s patch based workflow. Here comes the real patch.
This now uses the GUC - that was a lot easier than I thought.
I reviewed this and pushed it with some corrections. Thanks for
the contribution=21

Some notes:

* To make g=5Fweak actually act like a GUC, accept=5Fweak=5Finput() has to set it via set=5Fconfig=5Foption() not just overwrite it. Otherwise it won't roll back on transaction abort, for example. There was also
a missing MarkGUCPrefixReserved() call.
Makes sense. I actually thought about calling set=5F= config option but decided not fixing it was more backwards compatible. But can=E2=80=99t think of any reason why anyone wouldn=E2=80=99t want it= working like a true GUC.

* I concluded that the isn=5Fweak() functions ought to be marked like
set=5Fconfig() (VOLATILE and PARALLEL UNSA=46E) and current=5Fsetting() (STABLE and PARALLEL SA=46E). It's debatable whether a function that
reacts to a GUC should really be STABLE, since you can surely make its output change intra-query if you try. However, we pretty consistently
do that elsewhere because of the negative performance implications of
marking all such functions VOLATILE. The previous PARALLEL RESTRICTED
markings were probably okay when g=5Fweak's value couldn't propagate into=
parallel workers, but they're wrong now.
Makes sense

* You missed updating the module's meson.build file, which is hardly
your fault since I pointed you at an example commit that predated
our Meson support. But nowadays pretty much anything done to a
Makefile has to be reflected in meson.build and vice versa.

* I editorialized on the docs a bit, mostly to be more like existing
practice in other contrib modules. One point there is that =22GUC=22
is internal jargon that we prefer to avoid using in user-facing docs.
Agree you edits make it more clear.

All in all though, pretty close for a first contribution.
Thanks again=21

regards, tom lane
--67d743ac_22221a70_5a54--