pgsql: Make deadlock-parallel isolation test more robust.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Make deadlock-parallel isolation test more robust.
Date: 2019-08-17 22:15:44
Message-ID: E1hz6zA-0000N7-IY@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Make deadlock-parallel isolation test more robust.

This test failed fairly reproducibly on some CLOBBER_CACHE_ALWAYS
buildfarm animals. The cause seems to be that if a parallel worker
is slow enough to reach its lock wait, it may not be released by
the first deadlock check run, and then later deadlock checks might
decide to unblock the d2 session instead of the d1 session, leaving
us in an undetected deadlock state (since the isolationtester client
is waiting for d1 to complete first).

Fix by introducing an additional lock wait at the end of the d2a1
step, ensuring that the deadlock checker will recognize that d1
has to be unblocked before d2a1 completes.

Also reduce max_parallel_workers_per_gather to 3 in this test. With the
default max_worker_processes value, we were only getting one parallel
worker for the d2a1 step, which is not the case I hoped to test. We
should get 3 for d1a2 and 2 for d2a1, as the code stands; and maybe 3
for d2a1 if somebody figures out why the last parallel worker slot isn't
free already.

Discussion: https://postgr.es/m/22195.1566077308@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9be4ce4fa33594e035eb421894247e5af61393ce

Modified Files
--------------
src/test/isolation/expected/deadlock-parallel.out | 19 ++++++++----
src/test/isolation/specs/deadlock-parallel.spec | 36 +++++++++++++++++++----
2 files changed, 43 insertions(+), 12 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2019-08-18 04:54:34 pgsql: Remove obsolete reference to Irix
Previous Message Peter Eisentraut 2019-08-17 10:56:41 pgsql: Improve Assert output