forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc1afd17
committed
Allow amcheck to re-find tuples using new search.
Teach contrib/amcheck's bt_index_parent_check() function to takeadvantage of the uniqueness property of heapkeyspace indexes in supportof a new verification option: non-pivot tuples (non-highkey tuples onthe leaf level) can optionally be re-found using a new search for each,that starts from the root page. If a tuple cannot be re-found, reportthat the index is corrupt.The new "rootdescend" verification option is exhaustive, and cantherefore make a call to bt_index_parent_check() take a lot longer.Re-finding tuples during verification is mostly intended as an optionfor backend developers, since the corruption scenarios that it alone isuniquely capable of detecting seem fairly far-fetched.For example, "rootdescend" verification is much more likely to detectcorruption of the least significant byte of a key from a pivot tuple inthe root page of a B-Tree that already has at least three levels.Typically, only a few tuples on a cousin leaf page are at risk of"getting overlooked" by index scans in this scenario. The corrupt keyin the root page is only slightly corrupt: corrupt enough to give wronganswers to some queries, and yet not corrupt enough to allow the problemto be detected without verifying agreement between the leaf page and theroot page, skipping at least one internal page level. The existingbt_index_parent_check() checks never cross more than a single level.Author: Peter GeogheganReviewed-By: Heikki LinnakangasDiscussion:https://postgr.es/m/CAH2-Wz=yTWnVu+HeHGKb2AGiADL9eprn-cKYAto4MkKOuiGtRQ@mail.gmail.com1 parentfab2502 commitc1afd17
File tree
7 files changed
+160
-16
lines changed- contrib/amcheck
- expected
- sql
- doc/src/sgml
7 files changed
+160
-16
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
7 |
| - | |
| 7 | + | |
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
|
Lines changed: 19 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + |
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 |
| - | |
| 3 | + | |
4 | 4 |
| |
5 | 5 |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
126 | 126 |
| |
127 | 127 |
| |
128 | 128 |
| |
129 |
| - | |
| 129 | + | |
| 130 | + | |
130 | 131 |
| |
131 | 132 |
| |
132 | 133 |
| |
| |||
137 | 138 |
| |
138 | 139 |
| |
139 | 140 |
| |
140 |
| - | |
| 141 | + | |
141 | 142 |
| |
142 | 143 |
| |
143 | 144 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
78 | 78 |
| |
79 | 79 |
| |
80 | 80 |
| |
81 |
| - | |
| 81 | + | |
| 82 | + | |
82 | 83 |
| |
83 | 84 |
| |
84 | 85 |
| |
| |||
89 | 90 |
| |
90 | 91 |
| |
91 | 92 |
| |
92 |
| - | |
| 93 | + | |
93 | 94 |
| |
94 | 95 |
| |
95 | 96 |
| |
|
Lines changed: 128 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
75 | 75 |
| |
76 | 76 |
| |
77 | 77 |
| |
| 78 | + | |
| 79 | + | |
78 | 80 |
| |
79 | 81 |
| |
80 | 82 |
| |
| |||
124 | 126 |
| |
125 | 127 |
| |
126 | 128 |
| |
127 |
| - | |
| 129 | + | |
128 | 130 |
| |
129 | 131 |
| |
130 |
| - | |
| 132 | + | |
| 133 | + | |
131 | 134 |
| |
132 | 135 |
| |
133 | 136 |
| |
| |||
140 | 143 |
| |
141 | 144 |
| |
142 | 145 |
| |
| 146 | + | |
143 | 147 |
| |
144 | 148 |
| |
145 | 149 |
| |
| |||
177 | 181 |
| |
178 | 182 |
| |
179 | 183 |
| |
180 |
| - | |
| 184 | + | |
181 | 185 |
| |
182 | 186 |
| |
183 | 187 |
| |
| |||
196 | 200 |
| |
197 | 201 |
| |
198 | 202 |
| |
| 203 | + | |
199 | 204 |
| |
200 |
| - | |
| 205 | + | |
201 | 206 |
| |
| 207 | + | |
| 208 | + | |
202 | 209 |
| |
203 |
| - | |
| 210 | + | |
204 | 211 |
| |
205 | 212 |
| |
206 | 213 |
| |
| |||
209 | 216 |
| |
210 | 217 |
| |
211 | 218 |
| |
212 |
| - | |
| 219 | + | |
| 220 | + | |
213 | 221 |
| |
214 | 222 |
| |
215 | 223 |
| |
| |||
267 | 275 |
| |
268 | 276 |
| |
269 | 277 |
| |
270 |
| - | |
| 278 | + | |
271 | 279 |
| |
272 | 280 |
| |
273 | 281 |
| |
| |||
338 | 346 |
| |
339 | 347 |
| |
340 | 348 |
| |
341 |
| - | |
| 349 | + | |
342 | 350 |
| |
343 | 351 |
| |
344 | 352 |
| |
| |||
362 | 370 |
| |
363 | 371 |
| |
364 | 372 |
| |
| 373 | + | |
365 | 374 |
| |
366 | 375 |
| |
367 | 376 |
| |
| |||
430 | 439 |
| |
431 | 440 |
| |
432 | 441 |
| |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
433 | 450 |
| |
434 | 451 |
| |
435 | 452 |
| |
| |||
922 | 939 |
| |
923 | 940 |
| |
924 | 941 |
| |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
925 | 967 |
| |
926 | 968 |
| |
927 | 969 |
| |
| |||
1526 | 1568 |
| |
1527 | 1569 |
| |
1528 | 1570 |
| |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
1529 | 1574 |
| |
1530 | 1575 |
| |
1531 | 1576 |
| |
| |||
1926 | 1971 |
| |
1927 | 1972 |
| |
1928 | 1973 |
| |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
1929 | 2049 |
| |
1930 | 2050 |
| |
1931 | 2051 |
| |
|
Lines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
112 | 112 |
| |
113 | 113 |
| |
114 | 114 |
| |
115 |
| - | |
| 115 | + | |
116 | 116 |
| |
117 | 117 |
| |
118 | 118 |
| |
| |||
126 | 126 |
| |
127 | 127 |
| |
128 | 128 |
| |
129 |
| - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
130 | 133 |
| |
131 | 134 |
| |
132 | 135 |
| |
|
0 commit comments
Comments
(0)