Re: Do sys logger and stats collector need wait events WAIT_EVENT_SYSLOGGER_MAIN/_PGSTAT_MAIN?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Do sys logger and stats collector need wait events WAIT_EVENT_SYSLOGGER_MAIN/_PGSTAT_MAIN?
Date: 2021-12-03 17:42:47
Message-ID: 2312750.1638553367@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> writes:
> Although the pg_stat_activity has no entry for the sys logger and
> stats collector (because of no shared memory access), the wait events
> WAIT_EVENT_SYSLOGGER_MAIN and WAIT_EVENT_PGSTAT_MAIN are defined. They
> seem to be unnecessary. Passing 0 or some other undefined wait event
> value to the existing calls of WaitLatch and WaitLatchOrSocket instead
> of WAIT_EVENT_SYSLOGGER_MAIN/WAIT_EVENT_PGSTAT_MAIN, would work. We
> can delete these wait events and their info from pgstat.c.

Well ... mumble. The fact that these events are defined would lead
people to wonder why they're not hit, so there's a documentation reason
to get rid of them. However, I quite dislike the suggestion of "just
pass zero"; that will probably draw compiler warnings, or if it doesn't
it should. We'd have to invent some other "unused" wait event, and
then it's not clear that we've made any gain in intelligibility.

On the whole I'd be inclined to leave it alone. Even if the reporting
mechanisms aren't able to report these events today, maybe they'll
be able to do so in future. The context of the stats collector
process, in particular, seems likely to change.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-12-03 17:45:34 Re: Remove extra Logging_collector check before calling SysLogger_Start()
Previous Message Andrew Dunstan 2021-12-03 17:28:11 Re: pg_dump versus ancient server versions