Re: Our naming of wait events is a disaster.
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@lists.postgresql.org
Cc: Isaac Morland <isaac.morland@gmail.com>,
Alvaro Herrera <alvherre@2ndquadrant.com>,
Robert Haas <robertmhaas@gmail.com>
Date: 2020-05-14T01:29:25Z
Lists: pgsql-hackers
Attachments
- simplify-management-of-builtin-lwlocks.patch (text/x-diff) patch
The attached patch doesn't actually change any LWLock names, but it is a useful start on that project. What it does is to get rid of the current scheme of dynamically registering the names of built-in LWLocks in favor of having a constant array of those names. It's completely foolish to expend process-startup cycles on constructing an array of constant data; moreover, the way things are done now results in the tranche names being defined all over creation. I draw a short straight line between that technique and the lack of consistency in the tranche names. Given that we have an enum in lwlock.h enumerating the built-in tranches, there's certainly no expectation that somebody's going to create a new one without letting the lwlock module know about it, so this gives up no flexibility. In fact, it adds some, because we can now name an SLRU's buffer-locks tranche whatever we want --- it's not hard-wired as being the same as the SLRU's base name. The dynamic registration mechanism is still there, but it's now *only* used if you load an extension that creates dynamic LWLocks. At some point it might be interesting to generate the enum BuiltinTrancheIds and the BuiltinTrancheNames array from a common source file, as we do for lwlocknames.h/.c. I didn't feel a need to make that happen today, though. regards, tom lane
Commits
-
Mop-up for wait event naming issues.
- 3048898e73c7 13.0 landed
-
Change locktype "speculative token" to "spectoken".
- 474e7da64856 13.0 landed
-
Drop the redundant "Lock" suffix from LWLock wait event names.
- 14a910109126 13.0 landed
-
Rename assorted LWLock tranches.
- 36ac359d3621 13.0 landed
-
Rename SLRU structures and associated LWLocks.
- 5da14938f7bf 13.0 landed
-
Collect built-in LWLock tranche names statically, not dynamically.
- 29c3e2dd5a6a 13.0 landed