Re: shared-memory based stats collector

From: Andres Freund <andres(at)anarazel(dot)de>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, gkokolatos(at)protonmail(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: shared-memory based stats collector
Date: 2021-03-11 03:21:00
Message-ID: 20210311032100.sy25nnjowg7jjf5a@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Two minor nits:

On 2021-03-10 21:47:51 +0900, Fujii Masao wrote:
> +/* Shared memory area for archiver process */
> +typedef struct PgArchData
> +{
> + Latch *latch; /* latch to wake the archiver up */
> + slock_t mutex; /* locks this struct */
> +} PgArchData;
> +

It doesn't really matter, but it'd be pretty trivial to avoid needing a
spinlock for this kind of thing. Just store the pgprocno of the archiver
in PgArchData.

While getting rid of the spinlock doesn't seem like a huge win, it does
seem nicer that we'd automatically have a way to find data about the
archiver (e.g. pid).

> * checkpointer to exit as well, otherwise not. The archiver, stats,
> * and syslogger processes are disregarded since they are not
> * connected to shared memory; we also disregard dead_end children
> * here. Walsenders are also disregarded, they will be terminated
> * later after writing the checkpoint record, like the archiver
> * process.
> */

This comment in PostmasterStateMachine() is outdated now.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2021-03-11 03:37:39 Re: PostmasterIsAlive() in recovery (non-USE_POST_MASTER_DEATH_SIGNAL builds)
Previous Message Justin Pryzby 2021-03-11 03:20:57 Re: [HACKERS] Custom compression methods