forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4ce3afb
committed
Refactor how VACUUM passes around its XID cutoffs.
Use a dedicated struct for the XID/MXID cutoffs used by VACUUM, such asFreezeLimit and OldestXmin. This state is initialized in vacuum.c, andthen passed around by code from vacuumlazy.c to heapam.c freezingrelated routines. The new convention is that everybody works off of thesame cutoff state, which is passed around via pointers to const.Also simplify some of the logic for dealing with frozen xmin inheap_prepare_freeze_tuple: add dedicated "xmin_already_frozen" state toclearly distinguish xmin XIDs that we're going to freeze from those thatwere already frozen from before. That way the routine's xmin handlingcode is symmetrical with the existing xmax handling code. This ispreparation for an upcoming commit that will add page level freezing.Also refactor the control flow within FreezeMultiXactId(), while addingstricter sanity checks. We now test OldestXmin directly, instead ofusing FreezeLimit as an inexact proxy for OldestXmin. This is furtherpreparation for the page level freezing work, which will make thefunction's caller cede control of page level freezing to the functionwhere appropriate (where heap_prepare_freeze_tuple sees a tuple thathappens to contain a MultiXactId in its xmax).Author: Peter Geoghegan <pg@bowt.ie>Reviewed-By: Jeff Davis <pgsql@j-davis.com>Discussion:https://postgr.es/m/CAH2-WznS9TxXmz2_=SY+SyJyDFbiOftKofM9=aDo68BbXNBUMA@mail.gmail.com1 parente42e312 commit4ce3afb
File tree
8 files changed
+431
-458
lines changed- src
- backend
- access
- heap
- transam
- commands
- include
- access
- commands
8 files changed
+431
-458
lines changedLines changed: 232 additions & 246 deletions
Large diffs are not rendered by default.
Lines changed: 81 additions & 115 deletions
Large diffs are not rendered by default.
Lines changed: 3 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2813 | 2813 |
| |
2814 | 2814 |
| |
2815 | 2815 |
| |
2816 |
| - | |
2817 |
| - | |
| 2816 | + | |
| 2817 | + | |
2818 | 2818 |
| |
2819 | 2819 |
| |
2820 |
| - | |
2821 |
| - | |
2822 |
| - | |
2823 |
| - | |
| 2820 | + | |
2824 | 2821 |
| |
2825 | 2822 |
| |
2826 | 2823 |
| |
|
Lines changed: 12 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
826 | 826 |
| |
827 | 827 |
| |
828 | 828 |
| |
829 |
| - | |
830 |
| - | |
831 |
| - | |
832 |
| - | |
| 829 | + | |
833 | 830 |
| |
834 | 831 |
| |
835 | 832 |
| |
| |||
918 | 915 |
| |
919 | 916 |
| |
920 | 917 |
| |
921 |
| - | |
922 |
| - | |
| 918 | + | |
923 | 919 |
| |
924 | 920 |
| |
925 | 921 |
| |
926 | 922 |
| |
927 | 923 |
| |
928 | 924 |
| |
929 |
| - | |
930 |
| - | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
931 | 928 |
| |
932 | 929 |
| |
933 | 930 |
| |
934 | 931 |
| |
935 | 932 |
| |
936 |
| - | |
937 |
| - | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
938 | 936 |
| |
939 | 937 |
| |
940 | 938 |
| |
| |||
973 | 971 |
| |
974 | 972 |
| |
975 | 973 |
| |
976 |
| - | |
| 974 | + | |
| 975 | + | |
977 | 976 |
| |
978 | 977 |
| |
979 | 978 |
| |
980 | 979 |
| |
981 |
| - | |
982 |
| - | |
| 980 | + | |
| 981 | + | |
983 | 982 |
| |
984 | 983 |
| |
985 | 984 |
| |
|
Lines changed: 55 additions & 65 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
907 | 907 |
| |
908 | 908 |
| |
909 | 909 |
| |
910 |
| - | |
| 910 | + | |
911 | 911 |
| |
912 | 912 |
| |
913 | 913 |
| |
914 |
| - | |
915 |
| - | |
916 |
| - | |
917 |
| - | |
918 |
| - | |
919 |
| - | |
920 |
| - | |
921 |
| - | |
922 |
| - | |
| 914 | + | |
923 | 915 |
| |
924 | 916 |
| |
925 | 917 |
| |
926 | 918 |
| |
927 | 919 |
| |
928 |
| - | |
929 |
| - | |
930 |
| - | |
931 |
| - | |
932 |
| - | |
933 | 920 |
| |
934 | 921 |
| |
935 |
| - | |
936 |
| - | |
937 |
| - | |
| 922 | + | |
| 923 | + | |
938 | 924 |
| |
939 | 925 |
| |
940 | 926 |
| |
| |||
954 | 940 |
| |
955 | 941 |
| |
956 | 942 |
| |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
957 | 947 |
| |
958 | 948 |
| |
959 | 949 |
| |
| |||
965 | 955 |
| |
966 | 956 |
| |
967 | 957 |
| |
968 |
| - | |
| 958 | + | |
969 | 959 |
| |
970 | 960 |
| |
971 | 961 |
| |
972 | 962 |
| |
973 | 963 |
| |
974 | 964 |
| |
975 |
| - | |
| 965 | + | |
976 | 966 |
| |
977 | 967 |
| |
978 | 968 |
| |
| |||
982 | 972 |
| |
983 | 973 |
| |
984 | 974 |
| |
985 |
| - | |
| 975 | + | |
986 | 976 |
| |
987 | 977 |
| |
988 | 978 |
| |
989 |
| - | |
| 979 | + | |
990 | 980 |
| |
991 | 981 |
| |
992 |
| - | |
993 |
| - | |
| 982 | + | |
| 983 | + | |
994 | 984 |
| |
995 | 985 |
| |
996 | 986 |
| |
997 | 987 |
| |
998 | 988 |
| |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
999 | 1017 |
| |
1000 | 1018 |
| |
1001 | 1019 |
| |
| |||
1008 | 1026 |
| |
1009 | 1027 |
| |
1010 | 1028 |
| |
1011 |
| - | |
1012 |
| - | |
1013 |
| - | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
1014 | 1032 |
| |
1015 |
| - | |
1016 |
| - | |
1017 |
| - | |
1018 |
| - | |
1019 |
| - | |
1020 |
| - | |
1021 |
| - | |
1022 |
| - | |
1023 |
| - | |
| 1033 | + | |
| 1034 | + | |
1024 | 1035 |
| |
1025 | 1036 |
| |
1026 | 1037 |
| |
| |||
1035 | 1046 |
| |
1036 | 1047 |
| |
1037 | 1048 |
| |
1038 |
| - | |
1039 |
| - | |
1040 |
| - | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
1041 | 1052 |
| |
1042 |
| - | |
1043 |
| - | |
1044 |
| - | |
1045 |
| - | |
1046 |
| - | |
1047 |
| - | |
1048 |
| - | |
1049 |
| - | |
1050 |
| - | |
1051 |
| - | |
1052 |
| - | |
1053 |
| - | |
1054 |
| - | |
1055 |
| - | |
1056 |
| - | |
1057 |
| - | |
1058 |
| - | |
1059 |
| - | |
1060 |
| - | |
1061 |
| - | |
1062 |
| - | |
1063 |
| - | |
1064 |
| - | |
| 1053 | + | |
| 1054 | + | |
1065 | 1055 |
| |
1066 | 1056 |
| |
1067 | 1057 |
| |
| |||
1113 | 1103 |
| |
1114 | 1104 |
| |
1115 | 1105 |
| |
1116 |
| - | |
1117 |
| - | |
1118 | 1106 |
| |
1119 | 1107 |
| |
1120 | 1108 |
| |
1121 |
| - | |
| 1109 | + | |
1122 | 1110 |
| |
| 1111 | + | |
| 1112 | + | |
1123 | 1113 |
| |
1124 | 1114 |
| |
1125 | 1115 |
| |
|
Lines changed: 5 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
38 | 38 |
| |
39 | 39 |
| |
40 | 40 |
| |
| 41 | + | |
41 | 42 |
| |
42 | 43 |
| |
43 | 44 |
| |
| |||
178 | 179 |
| |
179 | 180 |
| |
180 | 181 |
| |
181 |
| - | |
182 |
| - | |
| 182 | + | |
183 | 183 |
| |
184 | 184 |
| |
185 | 185 |
| |
| |||
188 | 188 |
| |
189 | 189 |
| |
190 | 190 |
| |
191 |
| - | |
192 |
| - | |
193 |
| - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
194 | 194 |
| |
195 | 195 |
| |
196 | 196 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1634 | 1634 |
| |
1635 | 1635 |
| |
1636 | 1636 |
| |
1637 |
| - | |
| 1637 | + | |
1638 | 1638 |
| |
1639 | 1639 |
| |
1640 | 1640 |
| |
|
Lines changed: 42 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
235 | 235 |
| |
236 | 236 |
| |
237 | 237 |
| |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
238 | 277 |
| |
239 | 278 |
| |
240 | 279 |
| |
| |||
286 | 325 |
| |
287 | 326 |
| |
288 | 327 |
| |
289 |
| - | |
290 |
| - | |
291 |
| - | |
292 |
| - | |
293 |
| - | |
294 |
| - | |
295 |
| - | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
296 | 331 |
| |
297 | 332 |
| |
298 | 333 |
| |
|
0 commit comments
Comments
(0)