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

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Xuneng Zhou <xunengzhou(at)gmail(dot)com>
Cc: Alexander Lakhin <exclusion(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18158: Assert in pgstat_report_stat() fails when a backend shutting down with stats pending
Date: 2026-05-13 06:55:32
Message-ID: agQgZKF6q3rYRX7O@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, May 13, 2026 at 08:46:25AM +0800, Xuneng Zhou wrote:
> Thanks for reporting this. It appears like backpatching an equivalent
> of 87a6690cc69 to REL_17/REL_16 would resolve this issue.

FWIW, I fear such a change in the stable branches based on its
invasiveness, particularly because the area of the code dealing with
shutdown sequences has been reworked a lot lately as far as I recall.

I am seriously wondering if we should just let it go and remove the
assertion on v15~v17. It's not perfect, of course, but I value much
more this assertion in terms of any future work that can be done with
pgstats, not in terms of what we could detect for bug fixes.
--
Michael

In response to

Browse pgsql-bugs by date

  From Date Subject
Previous Message Xuneng Zhou 2026-05-13 03:30:41 Re: BUG #19439: pg_stat_xact_user_tables stat not currect during the transaction