- Notifications
You must be signed in to change notification settings - Fork5
Commitd53a566
committed
Initialize the minimum frozen Xid in vac_update_datfrozenxid using
GetOldestXmin() instead of RecentGlobalXmin; this is safer because we do notdepend on the latter being correctly set elsewhere, and while it is moreexpensive, this code path is not performance-critical. This is a realrisk for autovacuum, because it can execute whole cycles without doinga single vacuum, which would mean that RecentGlobalXmin would stay at itsinitialization value, FirstNormalTransactionId, causing a bogus value to beinserted in pg_database. This bug could explain some recent reports offailure to truncate pg_clog.At the same time, change the initialization of RecentGlobalXmin toInvalidTransactionId, and ensure that it's set to something else wheneverit's going to be used. Using it as FirstNormalTransactionId in HOT pagepruning could incur in data loss. InitPostgres takes care of setting itto a valid value, but the extra checks are there to prevent "special"backends from behaving in unusual ways.Per Tom Lane's detailed problem dissection in 29544.1221061979@sss.pgh.pa.us1 parentb864601 commitd53a566
File tree
6 files changed
+43
-35
lines changed- src/backend
- access
- heap
- index
- commands
- executor
- utils
- init
- time
6 files changed
+43
-35
lines changedLines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
219 | 219 |
| |
220 | 220 |
| |
221 | 221 |
| |
| 222 | + | |
222 | 223 |
| |
223 | 224 |
| |
224 | 225 |
| |
| |||
1469 | 1470 |
| |
1470 | 1471 |
| |
1471 | 1472 |
| |
| 1473 | + | |
| 1474 | + | |
1472 | 1475 |
| |
1473 | 1476 |
| |
1474 | 1477 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
419 | 419 |
| |
420 | 420 |
| |
421 | 421 |
| |
| 422 | + | |
| 423 | + | |
422 | 424 |
| |
423 | 425 |
| |
424 | 426 |
| |
|
Lines changed: 19 additions & 28 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
16 |
| - | |
| 16 | + | |
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
| |||
790 | 790 |
| |
791 | 791 |
| |
792 | 792 |
| |
793 |
| - | |
794 |
| - | |
795 |
| - | |
796 |
| - | |
797 |
| - | |
798 |
| - | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
799 | 797 |
| |
800 |
| - | |
| 798 | + | |
801 | 799 |
| |
802 | 800 |
| |
803 | 801 |
| |
| |||
990 | 988 |
| |
991 | 989 |
| |
992 | 990 |
| |
993 |
| - | |
994 |
| - | |
995 |
| - | |
996 |
| - | |
997 |
| - | |
998 |
| - | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
999 | 998 |
| |
1000 | 999 |
| |
1001 |
| - | |
1002 |
| - | |
1003 |
| - | |
1004 |
| - | |
| 1000 | + | |
1005 | 1001 |
| |
1006 | 1002 |
| |
1007 | 1003 |
| |
| |||
1050 | 1046 |
| |
1051 | 1047 |
| |
1052 | 1048 |
| |
1053 |
| - | |
1054 |
| - | |
| 1049 | + | |
1055 | 1050 |
| |
1056 | 1051 |
| |
1057 | 1052 |
| |
| |||
1082 | 1077 |
| |
1083 | 1078 |
| |
1084 | 1079 |
| |
1085 |
| - | |
1086 |
| - | |
| 1080 | + | |
1087 | 1081 |
| |
1088 | 1082 |
| |
1089 | 1083 |
| |
| |||
1099 | 1093 |
| |
1100 | 1094 |
| |
1101 | 1095 |
| |
1102 |
| - | |
1103 |
| - | |
| 1096 | + | |
1104 | 1097 |
| |
1105 | 1098 |
| |
1106 | 1099 |
| |
| |||
1115 | 1108 |
| |
1116 | 1109 |
| |
1117 | 1110 |
| |
1118 |
| - | |
1119 |
| - | |
| 1111 | + | |
1120 | 1112 |
| |
1121 | 1113 |
| |
1122 | 1114 |
| |
| |||
1168 | 1160 |
| |
1169 | 1161 |
| |
1170 | 1162 |
| |
1171 |
| - | |
1172 |
| - | |
| 1163 | + | |
1173 | 1164 |
| |
1174 | 1165 |
| |
1175 | 1166 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
24 |
| - | |
| 24 | + | |
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
| |||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
| 40 | + | |
40 | 41 |
| |
41 | 42 |
| |
42 | 43 |
| |
| |||
262 | 263 |
| |
263 | 264 |
| |
264 | 265 |
| |
| 266 | + | |
265 | 267 |
| |
266 | 268 |
| |
267 | 269 |
| |
|
Lines changed: 8 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
47 | 47 |
| |
48 | 48 |
| |
49 | 49 |
| |
| 50 | + | |
50 | 51 |
| |
51 | 52 |
| |
52 | 53 |
| |
| |||
461 | 462 |
| |
462 | 463 |
| |
463 | 464 |
| |
464 |
| - | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
465 | 468 |
| |
466 | 469 |
| |
| 470 | + | |
467 | 471 |
| |
| 472 | + | |
| 473 | + | |
468 | 474 |
| |
469 | 475 |
| |
470 | 476 |
| |
|
Lines changed: 6 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
25 |
| - | |
| 25 | + | |
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
| |||
59 | 59 |
| |
60 | 60 |
| |
61 | 61 |
| |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
62 | 66 |
| |
63 | 67 |
| |
64 | 68 |
| |
65 |
| - | |
| 69 | + | |
66 | 70 |
| |
67 | 71 |
| |
68 | 72 |
| |
|
0 commit comments
Comments
(0)