forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit71b9549
committed
Overdue code review for transaction-level advisory locks patch.
Commit62c7bd3 had assorted problems, mostvisibly that it broke PREPARE TRANSACTION in the presence of session-leveladvisory locks (which should be ignored by PREPARE), as per a recentcomplaint from Stephen Rees. More abstractly, the patch made theLockMethodData.transactional flag not merely useless but outrightdangerous, because in point of fact that flag no longer tells you anythingat all about whether a lock is held transactionally. This fix thereforeremoves that flag altogether. We now rely entirely on the conventionalready in use in lock.c that transactional lock holds must be owned bysome ResourceOwner, while session holds are never so owned. Setting thelocallock struct's owner link to NULL thus denotes a session hold, andthere is no redundant marker for that.PREPARE TRANSACTION now works again when there are session-level advisorylocks, and it is also able to transfer transactional advisory locks to theprepared transaction, but for implementation reasons it throws an error ifwe hold both types of lock on a single lockable object. Perhaps it will beworth improving that someday.Assorted other minor cleanup and documentation editing, as well.Back-patch to 9.1, except that in the 9.1 branch I did not remove theLockMethodData.transactional flag for fear of causing an ABI break forany external code that might be examining those structs.1 parent1715ff1 commit71b9549
6 files changed
+264
-206
lines changedLines changed: 33 additions & 34 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15382 | 15382 |
| |
15383 | 15383 |
| |
15384 | 15384 |
| |
15385 |
| - | |
| 15385 | + | |
15386 | 15386 |
| |
15387 | 15387 |
| |
15388 | 15388 |
| |
| |||
15451 | 15451 |
| |
15452 | 15452 |
| |
15453 | 15453 |
| |
15454 |
| - | |
15455 |
| - | |
15456 |
| - | |
| 15454 | + | |
| 15455 | + | |
15457 | 15456 |
| |
15458 |
| - | |
| 15457 | + | |
15459 | 15458 |
| |
15460 | 15459 |
| |
15461 | 15460 |
| |
| |||
15489 | 15488 |
| |
15490 | 15489 |
| |
15491 | 15490 |
| |
| 15491 | + | |
| 15492 | + | |
| 15493 | + | |
| 15494 | + | |
| 15495 | + | |
| 15496 | + | |
| 15497 | + | |
| 15498 | + | |
| 15499 | + | |
| 15500 | + | |
| 15501 | + | |
| 15502 | + | |
| 15503 | + | |
| 15504 | + | |
| 15505 | + | |
| 15506 | + | |
| 15507 | + | |
| 15508 | + | |
| 15509 | + | |
| 15510 | + | |
| 15511 | + | |
| 15512 | + | |
| 15513 | + | |
| 15514 | + | |
| 15515 | + | |
| 15516 | + | |
| 15517 | + | |
| 15518 | + | |
| 15519 | + | |
15492 | 15520 |
| |
15493 | 15521 |
| |
15494 | 15522 |
| |
| |||
15527 | 15555 |
| |
15528 | 15556 |
| |
15529 | 15557 |
| |
15530 |
| - | |
15531 |
| - | |
15532 |
| - | |
15533 |
| - | |
15534 |
| - | |
15535 |
| - | |
15536 |
| - | |
15537 |
| - | |
15538 |
| - | |
15539 |
| - | |
15540 |
| - | |
15541 |
| - | |
15542 |
| - | |
15543 |
| - | |
15544 |
| - | |
15545 |
| - | |
15546 |
| - | |
15547 |
| - | |
15548 |
| - | |
15549 |
| - | |
15550 |
| - | |
15551 |
| - | |
15552 |
| - | |
15553 |
| - | |
15554 |
| - | |
15555 |
| - | |
15556 |
| - | |
15557 |
| - | |
15558 |
| - | |
15559 | 15558 |
| |
15560 | 15559 |
| |
15561 | 15560 |
| |
|
Lines changed: 45 additions & 31 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1207 | 1207 |
| |
1208 | 1208 |
| |
1209 | 1209 |
| |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
1210 | 1214 |
| |
1211 | 1215 |
| |
1212 | 1216 |
| |
| |||
1218 | 1222 |
| |
1219 | 1223 |
| |
1220 | 1224 |
| |
1221 |
| - | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
1222 | 1233 |
| |
1223 | 1234 |
| |
1224 |
| - | |
1225 |
| - | |
1226 |
| - | |
1227 |
| - | |
1228 |
| - | |
1229 |
| - | |
1230 |
| - | |
1231 |
| - | |
1232 |
| - | |
1233 |
| - | |
1234 |
| - | |
1235 |
| - | |
1236 |
| - | |
1237 |
| - | |
1238 |
| - | |
1239 |
| - | |
1240 |
| - | |
1241 |
| - | |
1242 |
| - | |
1243 |
| - | |
1244 |
| - | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
1245 | 1257 |
| |
1246 | 1258 |
| |
1247 | 1259 |
| |
1248 |
| - | |
1249 |
| - | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
1250 | 1270 |
| |
1251 | 1271 |
| |
1252 | 1272 |
| |
| |||
1257 | 1277 |
| |
1258 | 1278 |
| |
1259 | 1279 |
| |
1260 |
| - | |
1261 |
| - | |
1262 |
| - | |
1263 |
| - | |
1264 |
| - | |
1265 |
| - | |
1266 |
| - | |
| 1280 | + | |
1267 | 1281 |
| |
1268 | 1282 |
| |
1269 | 1283 |
| |
|
Lines changed: 8 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
587 | 587 |
| |
588 | 588 |
| |
589 | 589 |
| |
590 |
| - | |
591 |
| - | |
| 590 | + | |
| 591 | + | |
592 | 592 |
| |
593 | 593 |
| |
594 | 594 |
| |
| |||
602 | 602 |
| |
603 | 603 |
| |
604 | 604 |
| |
605 |
| - | |
606 |
| - | |
607 |
| - | |
608 |
| - | |
609 |
| - | |
610 |
| - | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
611 | 611 |
| |
612 | 612 |
| |
613 | 613 |
| |
|
0 commit comments
Comments
(0)