forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3420851
committed
Fix busted logic for parallel lock grouping in TopoSort().
A "break" statement erroneously left behind by commita1c1af2caused TopoSort to do the wrong thing if a lock's wait listcontained multiple members of the same locking group.Because parallel workers don't normally need any locks not alreadytaken by their leader, this is very hard --- maybe impossible ---to hit in production. Still, if it did happen, the queries involvedin an otherwise-resolvable deadlock would block until canceled.In addition to removing the bogus "break", add an Assert showingthat the conflicting uses of the beforeConstraints[] array (for bothcounts and flags) don't overlap, and add some commentary explainingwhy not; because it's not obvious without explanation, IMHO.Original report and patch from Rui Hai Jiang; additional assertand 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.com1 parent1e2fddf commit3420851
1 file changed
+7
-1
lines changedLines changed: 7 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
922 | 922 |
| |
923 | 923 |
| |
924 | 924 |
| |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
925 | 931 |
| |
926 | 932 |
| |
927 | 933 |
| |
| |||
940 | 946 |
| |
941 | 947 |
| |
942 | 948 |
| |
943 |
| - | |
944 | 949 |
| |
945 | 950 |
| |
946 | 951 |
| |
| |||
977 | 982 |
| |
978 | 983 |
| |
979 | 984 |
| |
| 985 | + | |
980 | 986 |
| |
981 | 987 |
| |
982 | 988 |
| |
|
0 commit comments
Comments
(0)