Re: WIP: new system catalog pg_wait_event

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Masahiro Ikeda <ikedamsh(at)oss(dot)nttdata(dot)com>
Cc: "Drouvot, Bertrand" <bertranddrouvot(dot)pg(at)gmail(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: WIP: new system catalog pg_wait_event
Date: 2023-08-17 22:37:52
Message-ID: ZN6hQDvWkLVaps9o@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Aug 17, 2023 at 04:37:22PM +0900, Masahiro Ikeda wrote:
> On 2023-08-17 14:53, Drouvot, Bertrand wrote:
> BTW, is it better to start with "Waiting" like any other lines?
> For example, "Waiting for custom event \"worker_spi_main\" defined by an
> extension".

Using "Waiting for custom event" is a good term here. I am wondering
if this should be s/extension/module/, as an event could be set by a
loaded library, which may not be set with CREATE EXTENSION.

> ex.
> postgres(3789417)=# SELECT a.pid, a.wait_event_type, a.wait_event,
> w.description FROM pg_stat_activity a JOIN pg_wait_event w ON
> (a.wait_event_type = w.type AND a.wait_event = w.name) WHERE wait_event is
> NOT NULL;
> pid | wait_event_type | wait_event |
> description
> ---------+-----------------+-------------------+--------------------------------------------------------
> 3783759 | Activity | AutoVacuumMain | Waiting in main loop of
> autovacuum launcher process
> 3812866 | Extension | WorkerSpiMain | Custom wait event
> "WorkerSpiMain" defined by extension
> 3783756 | Activity | BgWriterHibernate | Waiting in background
> writer process, hibernating
> 3783760 | Activity | ArchiverMain | Waiting in main loop of
> archiver process
> 3783755 | Activity | CheckpointerMain | Waiting in main loop of
> checkpointer process
> 3783758 | Activity | WalWriterMain | Waiting in main loop of WAL
> writer process
> (6 rows)

You need to think about the PDF being generated from the SGML docs, as
well, so this should not be too large. I don't think we need to care
about wait_event_type for this example, so it can be removed. If the
tuple generated is still too large, showing one tuple under \x with a
filter on backend_type would be enough.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2023-08-17 23:19:14 Re: Fix an entry in wait_event_names.txt
Previous Message Michael Paquier 2023-08-17 22:28:04 Re: [PATCH] Add native windows on arm64 support