Re: On login trigger: take three
Daniel Gustafsson <daniel@yesql.se>
From: Daniel Gustafsson <daniel@yesql.se>
To: Alexander Korotkov <aekorotkov@gmail.com>
Cc: Mikhail Gribkov <youzhick@gmail.com>,
Robert Haas <robertmhaas@gmail.com>,
Andres Freund <andres@anarazel.de>,
Tom Lane <tgl@sss.pgh.pa.us>,
Greg Nancarrow <gregn4422@gmail.com>,
Ivan Panchenko <wao@mail.ru>,
Teodor Sigaev <teodor@sigaev.ru>,
Ibrar Ahmed <ibrar.ahmad@gmail.com>,
vignesh C <vignesh21@gmail.com>,
Pavel Stehule <pavel.stehule@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>,
Amit Kapila <amit.kapila16@gmail.com>,
Masahiko Sawada <sawada.mshk@gmail.com>
Date: 2023-09-25T12:42:15Z
Lists: pgsql-hackers
> On 25 Sep 2023, at 11:13, Alexander Korotkov <aekorotkov@gmail.com> wrote: > I'd like to do a short summary of > design issues on this thread. Thanks for summarizing this long thread! > the patch for the GUC option to disable > all event triggers resides in a separate thread [4]. Apparently that > patch should be committed first [5]. I have committed the prerequisite patch for temporarily disabling EVTs via a GUC in 7750fefdb2. We should absolutely avoid creating any more dependencies on single-user mode (yes, I have changed my mind since the beginning of the thread). > 3. Yet another question is connection-time overhead introduced by this > patch. The overhead estimate varies from no measurable overhead [6] to > 5% overhead [7]. In order to overcome that, [8] has introduced a > database-level flag indicating whether there are connection triggers. > Later this flag was removed [9] in a hope that the possible overhead > is acceptable. While I disliked the flag, I do think the overhead is problematic. Last time I profiled it I found it noticeable, and it seems expensive for such a niche feature to impact such a hot path. Maybe you can think of other ways to reduce the cost here (if it indeed is an issue in the latest version of the patch, which is not one I've benchmarked)? > 5. It was also pointed out [11] that ^C in psql doesn't cancel > long-running client connection triggers. That might be considered a > psql problem though. While it is a psql problem, it's exacerbated by a slow login EVT and it breaks what I would guess is the mental model of many who press ^C in a stalled login. At the very least we should probably document the risk? -- Daniel Gustafsson
Commits
-
Fix some typos in event trigger docs
- 5fce30e77fe1 17.0 landed
-
Use heap_inplace_update() to unset pg_database.dathasloginevt
- 8be93177c46b 17.0 landed
-
Remove the flaky check in event_trigger_login regression test
- 4b885d01f967 17.0 landed
-
Fix instable 006_login_trigger.pl test
- 06be01eb266b 17.0 landed
-
Add support event triggers on authenticated login
- e83d1b0c40cc 17.0 landed
-
Add GUC for temporarily disabling event triggers
- 7750fefdb2b8 17.0 landed
-
Fix typo in reference to __FreeBSD__.
- e52f8b301ed5 16.0 cited
-
Restore robustness of TAP tests that wait for postmaster restart.
- f452aaf7d4a9 14.0 cited
-
Restore the portal-level snapshot after procedure COMMIT/ROLLBACK.
- 84f5c2908dad 14.0 cited