Re: BUG #18158: Assert in pgstat_report_stat() fails when a backend shutting down with stats pending

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Xuneng Zhou <xunengzhou@gmail.com>
Cc: Alexander Lakhin <exclusion@gmail.com>, pgsql-bugs@lists.postgresql.org
Date: 2026-06-08T05:48:55Z
Lists: pgsql-bugs
On Sat, Jun 06, 2026 at 08:45:26PM +0800, Xuneng Zhou wrote:
> Sorry for being late. One nit for the patch -- would it be better to
> use AmWalSenderProcess() for identification to save the include?
> +#include "replication/walsender.h"

In the startup sequence, MyBackendType is updated to B_WAL_SENDER a
couple of lines after am_walsender.  One or the other don't really
matter; they're both right.
--
Michael

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Lift shutdown assertion in pgstats for WAL senders