Re: Orphaned wait event

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Orphaned wait event
Date: 2023-03-23 22:00:40
Message-ID: CA+hUKG+ewEpxm=hPNXyupRUB_SKGh-6tO86viaco0g-P_pm_Cw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Mar 23, 2023 at 8:10 PM Bharath Rupireddy
<bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
> Yeah, commit [1] removed the last trace of it. I wonder if we can add
> a WAIT_EVENT_SLRU_FLUSH_SYNC wait event in SlruSyncFileTag(), similar
> to mdsyncfiletag. This way, we would have covered all sync_syncfiletag
> fsyncs with wait events.

Ahh, right. Thanks. The mistake was indeed that SlruSyncFileTag
failed to report it while running pg_fsync().

> > In case it's useful again, here's how I noticed:
> >
> > for X in ` grep WAIT_EVENT_ src/include/utils/wait_event.h |
> > sed '/^#/d;s/,//;s/ = .*//' `
> > do
> > if ! ( git grep $X |
> > grep -v src/include/utils/wait_event.h |
> > grep -v src/backend/utils/activity/wait_event.c |
> > grep $X > /dev/null )
> > then
> > echo "$X is not used"
> > fi
> > done
>
> Interesting. It might be an overkill to think of placing it as a
> compile-time script to catch similar miss-outs in future.

Meh. Parsing C programs from shell scripts is fun for one-off
throw-away usage, but I think if we want proper automation here we
should look into a way to define wait events in a central file similar
to what we do for src/backend/storage/lmgr/lwlocknames.txt. It could
give the enum name, the display name, and the documentation sentence
on one tab-separated line, and we could generate all the rest from
that, or something like that? I suspect that downstream/monitoring
tools might appreciate the existence of such a file too.

Attachment Content-Type Size
0001-Fix-missing-WAIT_EVENT_SLRU_FLUSH_SYNC-reporting.patch application/x-patch 1.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2023-03-23 22:11:21 PGDOCS - function pg_get_publication_tables is not documented?
Previous Message Daniel Gustafsson 2023-03-23 21:46:56 Re: Raising the SCRAM iteration count