Re: WIP: new system catalog pg_wait_event - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: WIP: new system catalog pg_wait_event
Date
Msg-id ZN6hQDvWkLVaps9o@paquier.xyz
Whole thread Raw
In response to Re: WIP: new system catalog pg_wait_event  (Masahiro Ikeda <ikedamsh@oss.nttdata.com>)
Responses Re: WIP: new system catalog pg_wait_event
List 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

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [PATCH] Add native windows on arm64 support
Next
From: Michael Paquier
Date:
Subject: Re: Fix an entry in wait_event_names.txt