Re: Fix race condition in InvalidatePossiblyObsoleteSlot()

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, pgsql-hackers@lists.postgresql.org, exclusion@gmail.com
Date: 2024-03-06T11:21:14Z
Lists: pgsql-hackers
On Wed, Mar 06, 2024 at 09:17:58AM +0000, Bertrand Drouvot wrote:
> Right, somehow out of context here.

We're not yet in the green yet, one of my animals has complained:
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=hachi&dt=2024-03-06%2010%3A10%3A03

This is telling us that the xmin horizon is unchanged, and the test
cannot move on with the injection point wake up that would trigger the
following logs:
2024-03-06 20:12:59.039 JST [21143] LOG:  invalidating obsolete replication slot "injection_activeslot"
2024-03-06 20:12:59.039 JST [21143] DETAIL:  The slot conflicted with xid horizon 770.

Not sure what to think about that yet.
--
Michael

Commits

  1. Revert "Add recovery TAP test for race condition with slot invalidations"

  2. Add recovery TAP test for race condition with slot invalidations

  3. Fix race leading to incorrect conflict cause in InvalidatePossiblyObsoleteSlot()