Avoid use of NOTICE to wait for snapshot invalidation
authorÁlvaro Herrera <alvherre@kurilemu.de>
Tue, 2 Dec 2025 15:43:27 +0000 (16:43 +0100)
committerÁlvaro Herrera <alvherre@kurilemu.de>
Tue, 2 Dec 2025 15:43:27 +0000 (16:43 +0100)
commit5dee7a603f664115f8fe9819b0c19abd8209cd02
tree16655ba928aaad6448c2d6536dcd39f4a4cf1cc9
parent90eae926abbbcedbbea2ad5302722185e8652dca
Avoid use of NOTICE to wait for snapshot invalidation

This idea (implemented in commits and bc32a12e0db2 and 9e8fa05d3412) of
using notices to detect that a session is sleeping was unreliable, so
simplify the concurrency controller session to just look at
pg_stat_activity for a process sleeping on the injection point we want
it to hit.  This change allows us to remove a secondary injection point
and the alternative expected output files.

Reproduced by Alexander Lakhin following a report in buildfarm member
skink (which runs the server under valgrind).

Author: Mihail Nikalayeu <mihailnikalayeu@gmail.com>
Reported-by: Alexander Lakhin <exclusion@gmail.com>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Discussion: https://postgr.es/m/3e302c96-cdd2-45ec-af84-03dbcdccde4a@gmail.com
src/backend/utils/time/snapmgr.c
src/test/modules/injection_points/expected/index-concurrently-upsert-predicate.out
src/test/modules/injection_points/expected/index-concurrently-upsert-predicate_1.out [deleted file]
src/test/modules/injection_points/expected/index-concurrently-upsert.out
src/test/modules/injection_points/expected/index-concurrently-upsert_1.out [deleted file]
src/test/modules/injection_points/specs/index-concurrently-upsert-predicate.spec
src/test/modules/injection_points/specs/index-concurrently-upsert.spec