forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit450c823
committed
Don't hold ProcArrayLock longer than needed in rare cases
While cancelling an autovacuum worker, we hold ProcArrayLock whileformatting a debugging log string. We can make this shorter by savingthe data we need to produce the message and doing the formatting outsidethe locked region.This isn't terribly critical, as it only occurs pretty rarely: when abackend runs deadlock detection and it happens to be blocked by aautovacuum running autovacuum. Still, there's no need to cause a hiccupin ProcArrayLock processing, which can be very high-traffic in somecases.While at it, rework code so that we only print the string when it isreally going to be used, as suggested by Michael Paquier.Discussion:https://postgr.es/m/20201118214127.GA3179@alvherre.pgsqlReviewed-by: Michael Paquier <michael@paquier.xyz>1 parent0cc9932 commit450c823
1 file changed
+22
-13
lines changedLines changed: 22 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1311 | 1311 |
| |
1312 | 1312 |
| |
1313 | 1313 |
| |
| 1314 | + | |
| 1315 | + | |
1314 | 1316 |
| |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
1315 | 1326 |
| |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
1316 | 1331 |
| |
1317 | 1332 |
| |
1318 | 1333 |
| |
1319 | 1334 |
| |
1320 | 1335 |
| |
1321 |
| - | |
1322 | 1336 |
| |
1323 | 1337 |
| |
1324 | 1338 |
| |
1325 | 1339 |
| |
1326 | 1340 |
| |
1327 | 1341 |
| |
1328 | 1342 |
| |
| 1343 | + | |
1329 | 1344 |
| |
1330 | 1345 |
| |
1331 |
| - | |
| 1346 | + | |
1332 | 1347 |
| |
1333 | 1348 |
| |
1334 | 1349 |
| |
1335 |
| - | |
1336 |
| - | |
| 1350 | + | |
1337 | 1351 |
| |
1338 | 1352 |
| |
1339 |
| - | |
1340 |
| - | |
1341 |
| - | |
1342 |
| - | |
1343 | 1353 |
| |
1344 | 1354 |
| |
1345 | 1355 |
| |
1346 | 1356 |
| |
1347 | 1357 |
| |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
1348 | 1362 |
| |
1349 | 1363 |
| |
1350 | 1364 |
| |
| |||
1362 | 1376 |
| |
1363 | 1377 |
| |
1364 | 1378 |
| |
1365 |
| - | |
1366 |
| - | |
1367 |
| - | |
1368 | 1379 |
| |
1369 |
| - | |
1370 |
| - | |
1371 | 1380 |
| |
1372 | 1381 |
| |
1373 | 1382 |
| |
|
0 commit comments
Comments
(0)