forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite6799d5
committed
Move page initialization from RelationAddExtraBlocks() to use.
Previously we initialized pages when bulk extending inRelationAddExtraBlocks(). That has a major disadvantage: It tiesRelationAddExtraBlocks() to heap, as other types of storage are likelyto need different amounts of special space, have different amount offree space (previously determined by PageGetHeapFreeSpace()).That we're relying on initializing pages, but not WAL logging theinitialization, also means the risk for getting"WARNING: relation \"%s\" page %u is uninitialized --- fixing"style warnings in vacuums after crashes/immediate shutdowns, isconsiderably higher. The warning sounds much more serious than whatthey are.Fix those two issues together by not initializing pages inRelationAddExtraPages() (but continue to do so inRelationGetBufferForTuple(), which is linked much more closely toheap), and accepting uninitialized pages as normal invacuumlazy.c. When vacuumlazy encounters an empty page it now adds itto the FSM, but does nothing else. We chose to not issue a debugmessage, much less a warning in that case - it seems rarely useful,and quite likely to scare people unnecessarily.For now empty pages aren't added to the VM, because standbys would notre-discover such pages after a promotion. In contrast to other sourcesfor empty pages, there's no corresponding WAL records triggering FSMupdates during replay.Author: Andres FreundReviewed-By: Tom LaneDiscussion:https://postgr.es/m/20181219083945.6khtgm36mivonhva@alap3.anarazel.de1 parentd4316b8 commite6799d5
2 files changed
+59
-49
lines changedLines changed: 21 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
204 | 204 |
| |
205 | 205 |
| |
206 | 206 |
| |
207 |
| - | |
| 207 | + | |
| 208 | + | |
208 | 209 |
| |
209 | 210 |
| |
210 | 211 |
| |
| |||
216 | 217 |
| |
217 | 218 |
| |
218 | 219 |
| |
219 |
| - | |
220 |
| - | |
221 | 220 |
| |
222 |
| - | |
223 |
| - | |
224 |
| - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
225 | 227 |
| |
226 |
| - | |
227 |
| - | |
228 |
| - | |
229 | 228 |
| |
230 |
| - | |
| 229 | + | |
231 | 230 |
| |
232 | 231 |
| |
233 | 232 |
| |
| |||
479 | 478 |
| |
480 | 479 |
| |
481 | 480 |
| |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
482 | 493 |
| |
483 | 494 |
| |
484 | 495 |
| |
|
Lines changed: 38 additions & 39 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
861 | 861 |
| |
862 | 862 |
| |
863 | 863 |
| |
864 |
| - | |
865 |
| - | |
866 |
| - | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
867 | 869 |
| |
868 |
| - | |
869 |
| - | |
870 |
| - | |
871 |
| - | |
872 |
| - | |
873 |
| - | |
874 |
| - | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
875 | 873 |
| |
876 |
| - | |
877 |
| - | |
878 |
| - | |
879 |
| - | |
880 |
| - | |
881 |
| - | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
882 | 886 |
| |
883 |
| - | |
884 |
| - | |
885 |
| - | |
886 |
| - | |
887 |
| - | |
888 |
| - | |
889 |
| - | |
890 |
| - | |
891 |
| - | |
892 |
| - | |
893 |
| - | |
894 |
| - | |
895 |
| - | |
896 |
| - | |
897 | 887 |
| |
898 | 888 |
| |
899 |
| - | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
900 | 896 |
| |
901 | 897 |
| |
902 | 898 |
| |
| |||
905 | 901 |
| |
906 | 902 |
| |
907 | 903 |
| |
908 |
| - | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
909 | 908 |
| |
910 | 909 |
| |
911 | 910 |
| |
| |||
1639 | 1638 |
| |
1640 | 1639 |
| |
1641 | 1640 |
| |
1642 |
| - | |
1643 |
| - | |
1644 |
| - | |
1645 |
| - | |
1646 |
| - | |
1647 |
| - | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
1648 | 1648 |
| |
1649 | 1649 |
| |
1650 | 1650 |
| |
| |||
2029 | 2029 |
| |
2030 | 2030 |
| |
2031 | 2031 |
| |
2032 |
| - | |
2033 | 2032 |
| |
2034 | 2033 |
| |
2035 | 2034 |
| |
|
0 commit comments
Comments
(0)