- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit568d413
committed
Use an MVCC snapshot, rather than SnapshotNow, for catalog scans.
SnapshotNow scans have the undesirable property that, in the face ofconcurrent updates, the scan can fail to see either the old or the newversions of the row. In many cases, we work around this by requiringDDL operations to hold AccessExclusiveLock on the object beingmodified; in some cases, the existing locking is inadequate and randomfailures occur as a result. This commit doesn't change anythingrelated to locking, but will hopefully pave the way to allowing lockstrength reductions in the future.The major issue has held us back from making this change in the pastis that taking an MVCC snapshot is significantly more expensive thanusing a static special snapshot such as SnapshotNow. However, testingof various worst-case scenarios reveals that this problem is notsevere except under fairly extreme workloads. To mitigate thoseproblems, we avoid retaking the MVCC snapshot for each new scan;instead, we take a new snapshot only when invalidation messages havebeen processed. The catcache machinery already requires thatinvalidation messages be sent before releasing the related heavyweightlock; else other backends might rely on locally-cached data ratherthan scanning the catalog at all. Thus, making snapshot reusedependent on the same guarantees shouldn't break anything that wasn'talready subtly broken.Patch by me. Review by Michael Paquier and Andres Freund.1 parent384f933 commit568d413
File tree
69 files changed
+616
-352
lines changed- contrib
- dblink
- sepgsql
- doc/src/sgml
- src
- backend
- access
- heap
- index
- nbtree
- rmgrdesc
- bootstrap
- catalog
- commands
- executor
- postmaster
- rewrite
- storage/large_object
- utils
- adt
- cache
- init
- time
- bin/pg_dump
- include
- access
- catalog
- storage
- utils
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
69 files changed
+616
-352
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2046 | 2046 |
| |
2047 | 2047 |
| |
2048 | 2048 |
| |
2049 |
| - | |
| 2049 | + | |
2050 | 2050 |
| |
2051 | 2051 |
| |
2052 | 2052 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
727 | 727 |
| |
728 | 728 |
| |
729 | 729 |
| |
730 |
| - | |
| 730 | + | |
731 | 731 |
| |
732 | 732 |
| |
733 | 733 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
713 | 713 |
| |
714 | 714 |
| |
715 | 715 |
| |
716 |
| - | |
| 716 | + | |
717 | 717 |
| |
718 | 718 |
| |
719 | 719 |
| |
|
Lines changed: 19 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
80 | 80 |
| |
81 | 81 |
| |
82 | 82 |
| |
83 |
| - | |
| 83 | + | |
84 | 84 |
| |
85 | 85 |
| |
86 | 86 |
| |
| |||
1286 | 1286 |
| |
1287 | 1287 |
| |
1288 | 1288 |
| |
1289 |
| - | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
1290 | 1300 |
| |
1291 | 1301 |
| |
1292 | 1302 |
| |
| |||
1295 | 1305 |
| |
1296 | 1306 |
| |
1297 | 1307 |
| |
1298 |
| - | |
| 1308 | + | |
1299 | 1309 |
| |
1300 | 1310 |
| |
1301 | 1311 |
| |
1302 | 1312 |
| |
1303 | 1313 |
| |
1304 | 1314 |
| |
1305 | 1315 |
| |
1306 |
| - | |
| 1316 | + | |
1307 | 1317 |
| |
1308 | 1318 |
| |
1309 | 1319 |
| |
1310 | 1320 |
| |
1311 | 1321 |
| |
1312 | 1322 |
| |
1313 |
| - | |
| 1323 | + | |
1314 | 1324 |
| |
1315 | 1325 |
| |
1316 | 1326 |
| |
| |||
1335 | 1345 |
| |
1336 | 1346 |
| |
1337 | 1347 |
| |
| 1348 | + | |
1338 | 1349 |
| |
1339 | 1350 |
| |
1340 | 1351 |
| |
| |||
1421 | 1432 |
| |
1422 | 1433 |
| |
1423 | 1434 |
| |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
1424 | 1438 |
| |
1425 | 1439 |
| |
1426 | 1440 |
| |
|
Lines changed: 33 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
| 31 | + | |
31 | 32 |
| |
32 | 33 |
| |
33 | 34 |
| |
| |||
231 | 232 |
| |
232 | 233 |
| |
233 | 234 |
| |
234 |
| - | |
| 235 | + | |
235 | 236 |
| |
236 | 237 |
| |
237 | 238 |
| |
| |||
266 | 267 |
| |
267 | 268 |
| |
268 | 269 |
| |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
269 | 283 |
| |
270 | 284 |
| |
271 | 285 |
| |
| |||
401 | 415 |
| |
402 | 416 |
| |
403 | 417 |
| |
| 418 | + | |
| 419 | + | |
| 420 | + | |
404 | 421 |
| |
405 | 422 |
| |
406 | 423 |
| |
| |||
444 | 461 |
| |
445 | 462 |
| |
446 | 463 |
| |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
447 | 477 |
| |
448 | 478 |
| |
449 | 479 |
| |
| |||
494 | 524 |
| |
495 | 525 |
| |
496 | 526 |
| |
| 527 | + | |
| 528 | + | |
497 | 529 |
| |
498 | 530 |
|
Lines changed: 4 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
141 | 141 |
| |
142 | 142 |
| |
143 | 143 |
| |
144 |
| - | |
145 |
| - | |
146 |
| - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
147 | 148 |
| |
148 | 149 |
| |
149 | 150 |
| |
|
Lines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
69 | 69 |
| |
70 | 70 |
| |
71 | 71 |
| |
72 |
| - | |
| 72 | + | |
73 | 73 |
| |
74 | 74 |
| |
| 75 | + | |
75 | 76 |
| |
76 | 77 |
| |
| 78 | + | |
| 79 | + | |
77 | 80 |
| |
78 | 81 |
| |
79 | 82 |
| |
|
Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
611 | 611 |
| |
612 | 612 |
| |
613 | 613 |
| |
614 |
| - | |
| 614 | + | |
615 | 615 |
| |
616 | 616 |
| |
617 | 617 |
| |
| |||
620 | 620 |
| |
621 | 621 |
| |
622 | 622 |
| |
623 |
| - | |
| 623 | + | |
624 | 624 |
| |
625 | 625 |
| |
626 | 626 |
| |
| |||
918 | 918 |
| |
919 | 919 |
| |
920 | 920 |
| |
921 |
| - | |
| 921 | + | |
922 | 922 |
| |
923 | 923 |
| |
924 | 924 |
| |
| |||
927 | 927 |
| |
928 | 928 |
| |
929 | 929 |
| |
930 |
| - | |
| 930 | + | |
931 | 931 |
| |
932 | 932 |
| |
933 | 933 |
| |
|
Lines changed: 16 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
788 | 788 |
| |
789 | 789 |
| |
790 | 790 |
| |
791 |
| - | |
| 791 | + | |
792 | 792 |
| |
793 | 793 |
| |
794 | 794 |
| |
| |||
833 | 833 |
| |
834 | 834 |
| |
835 | 835 |
| |
836 |
| - | |
| 836 | + | |
837 | 837 |
| |
838 | 838 |
| |
839 | 839 |
| |
| |||
1332 | 1332 |
| |
1333 | 1333 |
| |
1334 | 1334 |
| |
1335 |
| - | |
| 1335 | + | |
1336 | 1336 |
| |
1337 | 1337 |
| |
1338 | 1338 |
| |
| |||
1452 | 1452 |
| |
1453 | 1453 |
| |
1454 | 1454 |
| |
1455 |
| - | |
| 1455 | + | |
1456 | 1456 |
| |
1457 | 1457 |
| |
1458 | 1458 |
| |
| |||
2705 | 2705 |
| |
2706 | 2706 |
| |
2707 | 2707 |
| |
2708 |
| - | |
| 2708 | + | |
2709 | 2709 |
| |
2710 | 2710 |
| |
2711 | 2711 |
| |
| |||
3468 | 3468 |
| |
3469 | 3469 |
| |
3470 | 3470 |
| |
3471 |
| - | |
| 3471 | + | |
3472 | 3472 |
| |
3473 | 3473 |
| |
3474 | 3474 |
| |
| |||
3856 | 3856 |
| |
3857 | 3857 |
| |
3858 | 3858 |
| |
3859 |
| - | |
3860 |
| - | |
3861 |
| - | |
3862 |
| - | |
| 3859 | + | |
| 3860 | + | |
| 3861 | + | |
| 3862 | + | |
| 3863 | + | |
| 3864 | + | |
| 3865 | + | |
3863 | 3866 |
| |
3864 | 3867 |
| |
3865 | 3868 |
| |
| |||
4644 | 4647 |
| |
4645 | 4648 |
| |
4646 | 4649 |
| |
4647 |
| - | |
| 4650 | + | |
4648 | 4651 |
| |
4649 | 4652 |
| |
4650 | 4653 |
| |
| |||
4670 | 4673 |
| |
4671 | 4674 |
| |
4672 | 4675 |
| |
4673 |
| - | |
| 4676 | + | |
4674 | 4677 |
| |
4675 | 4678 |
| |
4676 | 4679 |
| |
| |||
5032 | 5035 |
| |
5033 | 5036 |
| |
5034 | 5037 |
| |
5035 |
| - | |
| 5038 | + | |
5036 | 5039 |
| |
5037 | 5040 |
| |
5038 | 5041 |
| |
|
Lines changed: 10 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
218 | 218 |
| |
219 | 219 |
| |
220 | 220 |
| |
221 |
| - | |
222 |
| - | |
223 |
| - | |
224 |
| - | |
225 |
| - | |
226 |
| - | |
227 |
| - | |
228 |
| - | |
229 |
| - | |
230 |
| - | |
231 |
| - | |
232 |
| - | |
233 |
| - | |
234 |
| - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
235 | 231 |
| |
236 | 232 |
| |
237 | 233 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
558 | 558 |
| |
559 | 559 |
| |
560 | 560 |
| |
561 |
| - | |
| 561 | + | |
562 | 562 |
| |
563 | 563 |
| |
564 | 564 |
| |
| |||
733 | 733 |
| |
734 | 734 |
| |
735 | 735 |
| |
736 |
| - | |
| 736 | + | |
737 | 737 |
| |
738 | 738 |
| |
739 | 739 |
| |
| |||
1069 | 1069 |
| |
1070 | 1070 |
| |
1071 | 1071 |
| |
1072 |
| - | |
| 1072 | + | |
1073 | 1073 |
| |
1074 | 1074 |
| |
1075 | 1075 |
| |
|
0 commit comments
Comments
(0)