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

Started by Robert Haas30 days ago1 messagescommitters
Jump to latest
#1Robert Haas
rhaas@postgresql.org

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@gmail.com>
Reported-by: Nik Samokhvalov <nik@postgres.ai>
Author: Nik Samokhvalov <nik@postgres.ai>
Co-authored-by: Robert Haas <rhaas@postgresql.org> (whitespace changes)
Backpatch-through: 19
Discussion: /messages/by-id/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(-)