pgsql: Fix rare deadlock failure in create_am regression test.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix rare deadlock failure in create_am regression test.
Date: 2020-09-04 16:40:46
Message-ID: E1kEEla-00019S-7L@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix rare deadlock failure in create_am regression test.

The "DROP ACCESS METHOD gist2" test will require locking the index
to be dropped and then its table; while most ordinary operations
lock a table first then its index. While no concurrent test scripts
should be touching fast_emp4000, autovacuum might chance to be
processing that table when the DROP runs, resulting in a deadlock
failure. This is pretty rare but we see it in the buildfarm from
time to time.

To fix, acquire a lock on fast_emp4000 before issuing the DROP.

Since the point of the exercise is mostly to prevent buildfarm
failures, back-patch to 9.6 where this test was introduced.

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

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/afec6ba0bae0258835b81fcc0eeed3ff9c455427

Modified Files
--------------
src/test/regress/expected/create_am.out | 5 +++++
src/test/regress/sql/create_am.sql | 5 +++++
2 files changed, 10 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2020-09-04 17:28:09 pgsql: C comment: correct use of 64-"byte" cache line size
Previous Message Peter Eisentraut 2020-09-04 06:47:11 pgsql: doc: Fix whitespace issue in PDF