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-14T20:27:14Z
Lists: pgsql-hackers

Attachments

I wrote:
> Digging through the existing callers of SimpleLruInit, we have
> name                    control lock                    subdir
> "async"                 AsyncCtlLock                    "pg_notify"
> "clog"                  CLogControlLock                 "pg_xact"
> "commit_timestamp"      CommitTsControlLock             "pg_commit_ts"
> "multixact_member"      MultiXactMemberControlLock      "pg_multixact/members"
> "multixact_offset"      MultiXactOffsetControlLock      "pg_multixact/offsets"
> "oldserxid"             OldSerXidLock                   "pg_serial"
> "subtrans"              SubtransControlLock             "pg_subtrans"

> After studying that list for awhile, it seems to me that we could
> do worse than to name the SLRUs to match their on-disk subdirectories,
> which are names that are already user-visible.  So I propose these
> base names for the SLRUs:

> Notify
> Xact
> CommitTs
> MultiXactMember  (or MultiXactMembers)
> MultiXactOffset  (or MultiXactOffsets)
> Serial
> Subtrans

As POC for this, here's a draft patch to rename the "async" SLRU and
associated locks.  If people are good with this then I'll go through
and do similarly for the other SLRUs.

A case could be made for doing s/async/notify/ more widely in async.c;
for instance it's odd that the struct protected by NotifyQueueLock
didn't get renamed to NotifyQueueControl.  But that seems a bit out
of scope for the immediate problem, and anyway I'm not sure how far to
take it.  I don't really want to rename async.c's externally-visible
functions, for instance.  For the moment I just renamed symbols used
in the SimpleLruInit() call.

			regards, tom lane

Commits

  1. Mop-up for wait event naming issues.

  2. Change locktype "speculative token" to "spectoken".

  3. Drop the redundant "Lock" suffix from LWLock wait event names.

  4. Rename assorted LWLock tranches.

  5. Rename SLRU structures and associated LWLocks.

  6. Collect built-in LWLock tranche names statically, not dynamically.