pgsql: pg_stash_advice: Fix race conditions in 001_persist.pl

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: pg_stash_advice: Fix race conditions in 001_persist.pl
Date: 2026-10-30 16:45:31
Message-ID: E1xMpjP-00000001QaQ-2PZg@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

pg_stash_advice: Fix race conditions in 001_persist.pl

Each time we start the server, there's a brief lockout while the
persistence worker reloads stashes from disk. Until that's complete,
no stashes will be visible and no stash modifications can be made.
This test case failed to take that into account, and could therefore
fail spuriously.

Reported-by: Alexander Lakhin <exclusion(at)gmail(dot)com>
Reported-by: Nik Samokhvalov <nik(at)postgres(dot)ai>
Author: Nik Samokhvalov <nik(at)postgres(dot)ai>
Co-authored-by: Robert Haas <rhaas(at)postgresql(dot)org> (whitespace changes)
Backpatch-through: 19
Discussion: http://postgr.es/m/CAM527d8PqdbDy=PuTLYBJM8-FvvFDr2BLcyFyZhw6Oi9rXb14g@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/884aca9b96989b9bc1b65d42e731e90f098ee2ee

Modified Files
--------------
contrib/pg_stash_advice/t/001_persist.pl | 28 ++++++++++++++++++++++------
1 file changed, 22 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Jeff Davis 2026-10-30 17:28:50 pgsql: PG 19: expand on release notes for stemmer.
Previous Message Tom Lane 2026-10-30 15:03:25 pgsql: Return INT_MAX or INT_MIN from strtoint() on overflow.