- Notifications
You must be signed in to change notification settings - Fork5
Commit1192ba8
committed
Avoid potential deadlock in InitCatCachePhase2().
Opening a catcache's index could require reading from that cache's owncatalog, which of course would acquire AccessShareLock on the catalog.So the original coding here risks locking index before heap, which coulddeadlock against another backend trying to get exclusive locks in thenormal order. Because InitCatCachePhase2 is only called when a backendhas to start up without a relcache init file, the deadlock was seldom seenin the field. (And by the same token, there's no need to worry about anyperformance disadvantage; so not much point in trying to distinguishexactly which catalogs have the risk.)Bug report, diagnosis, and patch by Nikhil Sontakke. Additional commentaryby me. Back-patch to all supported branches.1 parent6e8e7cc commit1192ba8
2 files changed
+19
-0
lines changedLines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
| 29 | + | |
29 | 30 |
| |
30 | 31 |
| |
31 | 32 |
| |
| |||
967 | 968 |
| |
968 | 969 |
| |
969 | 970 |
| |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
970 | 978 |
| |
971 | 979 |
| |
| 980 | + | |
972 | 981 |
| |
973 | 982 |
| |
974 | 983 |
| |
|
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1651 | 1651 |
| |
1652 | 1652 |
| |
1653 | 1653 |
| |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
1654 | 1660 |
| |
1655 | 1661 |
| |
1656 | 1662 |
| |
| |||
3611 | 3617 |
| |
3612 | 3618 |
| |
3613 | 3619 |
| |
| 3620 | + | |
| 3621 | + | |
| 3622 | + | |
| 3623 | + | |
3614 | 3624 |
| |
3615 | 3625 |
| |
3616 | 3626 |
| |
|
0 commit comments
Comments
(0)