]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix rare deadlock failure in create_am regression test.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 4 Sep 2020 16:40:28 +0000 (12:40 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 4 Sep 2020 16:40:28 +0000 (12:40 -0400)
commit44f4986dd96bca9d847ccde9ee9428bd9901810b
tree6bbdb9e7a67e32fda31e460f1cede2d87e5d536e
parent2a938c7935cf838b99b2017c5f86f9435ad9ad7e
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
src/test/regress/expected/create_am.out
src/test/regress/sql/create_am.sql