Files
postgresql/src/backend
Tom Lane 3420851a2c Fix busted logic for parallel lock grouping in TopoSort().
A "break" statement erroneously left behind by commit a1c1af2a1
caused TopoSort to do the wrong thing if a lock's wait list
contained multiple members of the same locking group.

Because parallel workers don't normally need any locks not already
taken by their leader, this is very hard --- maybe impossible ---
to hit in production.  Still, if it did happen, the queries involved
in an otherwise-resolvable deadlock would block until canceled.

In addition to removing the bogus "break", add an Assert showing
that the conflicting uses of the beforeConstraints[] array (for both
counts and flags) don't overlap, and add some commentary explaining
why not; because it's not obvious without explanation, IMHO.

Original report and patch from Rui Hai Jiang; additional assert
and commentary by me.  Back-patch to 9.6 where the bug came in.

Discussion: https://postgr.es/m/CAEri+mLd3bpHLyW+a9pSe1y=aEkeuJpwBSwvo-+m4n7-ceRmXw@mail.gmail.com
2019-07-29 18:49:04 -04:00
..
2019-01-02 12:44:25 -05:00
2019-07-29 10:23:55 +12:00
2019-07-08 13:15:09 +09:00
2019-07-22 10:29:41 +12:00
2019-06-17 15:30:20 +02:00
2019-05-22 13:04:48 -04:00
2019-05-22 13:04:48 -04:00
2018-03-30 17:33:04 -07:00
2019-05-20 16:00:53 +02:00