postgresql/src
Tom Lane da9456d22a Add an isolation test to exercise parallel-worker deadlock resolution.
Commit a1c1af2a1 added logic in the deadlock checker to handle lock
grouping, but it was very poorly tested, as evidenced by the bug
fixed in 3420851a2.  Add a test case that exercises that a bit better
(and catches the bug --- if you revert 3420851a2, this will hang).

Since it's pretty hard to get parallel workers to take exclusive
regular locks that their parents don't already have, this test operates
by creating a deadlock among advisory locks taken in parallel workers.
To make that happen, we must override the parallel-safety labeling of
the advisory-lock functions, which we do by putting them in mislabeled,
non-inlinable wrapper functions.

We also have to remove the redundant PreventAdvisoryLocksInParallelMode
checks in lockfuncs.c.  That seems fine though; if some user accidentally
does what this test is intentionally doing, not much harm will ensue.
(If there are any remaining bugs that are reachable that way, they're
probably reachable in other ways too.)

Discussion: https://postgr.es/m/3243.1564437314@sss.pgh.pa.us
2019-08-01 11:50:00 -04:00
..
backend Add an isolation test to exercise parallel-worker deadlock resolution. 2019-08-01 11:50:00 -04:00
bin Fix pg_dump's handling of dependencies for custom opclasses. 2019-07-31 15:42:49 -04:00
common Fix inconsistencies and typos in the tree 2019-07-29 12:28:30 +09:00
fe_utils Fix memory leak coming from simple lists built in reindexdb 2019-07-30 10:54:48 +09:00
include Mark advisory-lock functions as parallel restricted, not parallel unsafe. 2019-08-01 11:36:21 -04:00
interfaces Fix inconsistencies and typos in the tree 2019-07-29 12:28:30 +09:00
makefiles Remove support for non-ELF BSD systems 2019-07-01 23:56:20 +01:00
pl Fix inconsistencies and typos in the tree 2019-07-29 12:28:30 +09:00
port Fix failures to ignore \r when reading Windows-style newlines. 2019-07-25 12:11:17 -04:00
template Yet further rethinking of build changes for macOS Mojave. 2018-11-02 18:54:00 -04:00
test Add an isolation test to exercise parallel-worker deadlock resolution. 2019-08-01 11:50:00 -04:00
timezone Tweak our special-case logic for the IANA "Factory" timezone. 2019-07-26 13:07:08 -04:00
tools Fix inconsistencies and typos in the tree 2019-07-29 12:28:30 +09:00
tutorial Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
.gitignore
DEVELOPERS
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Fix inconsistencies and typos in the tree 2019-07-29 12:28:30 +09:00
Makefile.shlib Remove support for non-ELF BSD systems 2019-07-01 23:56:20 +01:00
nls-global.mk Move logging.h and logging.c from src/fe_utils/ to src/common/. 2019-05-14 14:20:10 -04:00