pgsql: Avoid use of NOTICE to wait for snapshot invalidation

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Avoid use of NOTICE to wait for snapshot invalidation
Date: 2025-12-02 15:44:52
Message-ID: E1vQSYe-002SAB-0C@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)gmail(dot)com>
Reported-by: Alexander Lakhin <exclusion(at)gmail(dot)com>
Reviewed-by: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Discussion: https://postgr.es/m/3e302c96-cdd2-45ec-af84-03dbcdccde4a@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5dee7a603f664115f8fe9819b0c19abd8209cd02

Modified Files
--------------
src/backend/utils/time/snapmgr.c | 1 -
.../index-concurrently-upsert-predicate.out | 23 ++--
.../index-concurrently-upsert-predicate_1.out | 116 ---------------------
.../expected/index-concurrently-upsert.out | 29 ++++--
.../expected/index-concurrently-upsert_1.out | 116 ---------------------
.../specs/index-concurrently-upsert-predicate.spec | 21 +++-
.../specs/index-concurrently-upsert.spec | 27 +++--
7 files changed, 72 insertions(+), 261 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Álvaro Herrera 2025-12-02 15:50:12 pgsql: Remove doc and code comments about ON CONFLICT deficiencies
Previous Message Álvaro Herrera 2025-12-02 12:55:18 pgsql: Fix ON CONFLICT with REINDEX CONCURRENTLY and partitions