Re: BUG #19520: PANIC when concurrently manipulating stored procedures with pg_stat_statements and track_functions =

Ayush Tiwari <ayushtiwari.slg01@gmail.com>

From: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Sami Imseih <samimseih@gmail.com>, zlh21343@163.com, pgsql-bugs@lists.postgresql.org, Andres Freund <andres@anarazel.de>, Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Date: 2026-06-18T03:22:49Z
Lists: pgsql-bugs
Hi,

On Thu, 18 Jun 2026 at 06:33, Michael Paquier <michael@paquier.xyz> wrote:

>
> Attaching an updated patch for now.  I am still testing it locally
> across all the branches to make sure that the issue is gone (that
> takes quite a bit of time).  I'll probably apply it in a few hours
> down to v15 if nothing pops up.
>

The v2 patch looks fine to me. Tested it, no PANICs.

And the assert too looks good to me.

Regards,

Commits

  1. Re-introduce pgstat_drop_entry(), keeping ABI compatibility

  2. Update .abi-compliance-history for pgstat_drop_entry()

  3. Fix PANIC with track_functions due to concurrent drop of pgstats entries