]> granicus.if.org Git - postgresql/commit
Introduce group locking to prevent parallel processes from deadlocking.
authorRobert Haas <rhaas@postgresql.org>
Sun, 7 Feb 2016 15:16:13 +0000 (10:16 -0500)
committerRobert Haas <rhaas@postgresql.org>
Sun, 7 Feb 2016 15:16:13 +0000 (10:16 -0500)
commita1c1af2a1f6099c039f145c1edb52257f315be51
tree1cb89288ec139185a57ddda01ea53abf5df0c28a
parentaa2387e2fd532954e88dfd8546ab894b9305123d
Introduce group locking to prevent parallel processes from deadlocking.

For locking purposes, we now regard heavyweight locks as mutually
non-conflicting between cooperating parallel processes.  There are some
possible pitfalls to this approach that are not to be taken lightly,
but it works OK for now and can be changed later if we find a better
approach.  Without this, it's very easy for parallel queries to
silently self-deadlock if the user backend holds strong relation locks.

Robert Haas, with help from Amit Kapila.  Thanks to Noah Misch and
Andres Freund for extensive discussion of possible issues with this
approach.
src/backend/access/transam/parallel.c
src/backend/storage/lmgr/README
src/backend/storage/lmgr/deadlock.c
src/backend/storage/lmgr/lock.c
src/backend/storage/lmgr/proc.c
src/include/storage/lock.h
src/include/storage/proc.h