Re: Missing LWLock protection in pgstat_reset_replslot()

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: "Anton A. Melnikov" <a.melnikov@postgrespro.ru>, Tom Lane <tgl@sss.pgh.pa.us>, shveta malik <shveta.malik@gmail.com>, Heikki Linnakangas <hlinnaka@iki.fi>, pgsql-hackers@lists.postgresql.org
Date: 2024-12-09T01:48:42Z
Lists: pgsql-hackers
On Thu, Dec 05, 2024 at 07:11:54AM +0000, Bertrand Drouvot wrote:
> Yeah that seems the right thing to do for me too.

Thanks for the review.  I've looked a bit more at the other paths
handling dropped entries and they should be fine, created a TAP test
that's able to check the scenario sent by Anton with a background psql
session and some shutdown checks (critical part is the generation of
the pgstats file), then applied the fix down to v15.
--
Michael

Commits

  1. Fix invalidation of local pgstats references for entry reinitialization

  2. Improve consistency of replication slot statistics