Re: Our naming of wait events is a disaster.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Isaac Morland <isaac(dot)morland(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: Our naming of wait events is a disaster.
Date: 2020-05-14 20:27:14
Message-ID: 1261.1589488034@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
rename-async-SLRU-to-Notify.patch text/x-diff 20.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2020-05-14 20:56:54 Re: Our naming of wait events is a disaster.
Previous Message Robert Haas 2020-05-14 20:20:54 Re: Parallel copy