Re: BUG #18158: Assert in pgstat_report_stat() fails when a backend shutting down with stats pending
Xuneng Zhou <xunengzhou@gmail.com>
From: Xuneng Zhou <xunengzhou@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Alexander Lakhin <exclusion@gmail.com>, pgsql-bugs@lists.postgresql.org
Date: 2026-06-08T08:43:31Z
Lists: pgsql-bugs
On Mon, Jun 8, 2026 at 1:49 PM Michael Paquier <michael@paquier.xyz> wrote: > > 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. Yeah, both of them work well. To use AmWalSenderProcess(), we would need to include src/include/miscadmin.h, whereas using am_walsender requires including “replication/walsender.h”. I’m just wondering whether using AmWalSenderProcess() would result in less coupling between pgstat and replication. -- Regards, Xuneng Zhou HighGo Software Co., Ltd.
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Lift shutdown assertion in pgstats for WAL senders
- eeed86523bb9 15 (unreleased) landed
- 830b476d0bea 16 (unreleased) landed
- 4801610f7c66 17 (unreleased) landed