Commit 0bada39
committed
Fix inplace update buffer self-deadlock.
A CacheInvalidateHeapTuple* callee might call
CatalogCacheInitializeCache(), which needs a relcache entry. Acquiring
a valid relcache entry might scan pg_class. Hence, to prevent
undetected LWLock self-deadlock, CacheInvalidateHeapTuple* callers must
not hold BUFFER_LOCK_EXCLUSIVE on buffers of pg_class. Move the
CacheInvalidateHeapTupleInplace() before the BUFFER_LOCK_EXCLUSIVE. No
back-patch, since I've reverted commit
243e9b4 from non-master branches.
Reported by Alexander Lakhin. Reviewed by Alexander Lakhin.
Discussion: https://postgr.es/m/10ec0bc3-5933-1189-6bb8-5dec4114558e@gmail.com1 parent b412f40 commit 0bada39
3 files changed
+26
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6214 | 6214 | | |
6215 | 6215 | | |
6216 | 6216 | | |
| 6217 | + | |
| 6218 | + | |
| 6219 | + | |
| 6220 | + | |
| 6221 | + | |
| 6222 | + | |
| 6223 | + | |
| 6224 | + | |
| 6225 | + | |
| 6226 | + | |
| 6227 | + | |
6217 | 6228 | | |
6218 | 6229 | | |
6219 | 6230 | | |
| |||
6309 | 6320 | | |
6310 | 6321 | | |
6311 | 6322 | | |
| 6323 | + | |
6312 | 6324 | | |
6313 | 6325 | | |
6314 | 6326 | | |
| |||
6345 | 6357 | | |
6346 | 6358 | | |
6347 | 6359 | | |
6348 | | - | |
6349 | | - | |
6350 | | - | |
6351 | | - | |
6352 | | - | |
6353 | | - | |
6354 | | - | |
6355 | | - | |
6356 | 6360 | | |
6357 | 6361 | | |
6358 | 6362 | | |
| |||
6481 | 6485 | | |
6482 | 6486 | | |
6483 | 6487 | | |
| 6488 | + | |
6484 | 6489 | | |
6485 | 6490 | | |
6486 | 6491 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1201 | 1201 | | |
1202 | 1202 | | |
1203 | 1203 | | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
1204 | 1216 | | |
1205 | 1217 | | |
1206 | 1218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
0 commit comments