forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf2b8839
committed
Add pg_relation_check_pages() to check on-disk pages of a relation
This makes use of CheckBuffer() introduced inc780a7a, adding a SQLwrapper able to do checks for all the pages of a relation. By default,all the fork types of a relation are checked, and it is possible tocheck only a given relation fork. Note that if the relation given ininput has no physical storage or is temporary, then no errors aregenerated, allowing full-database checks when coupled with a simple scanof pg_class for example. This is not limited to clusters with datachecksums enabled, as clusters without data checksums can still applychecks on pages using the page headers or for the case of a page full ofzeros.This function returns a set of tuples consisting of:- The physical file where a broken page has been detected (without thesegment number as that can be AM-dependent, which can be guessed fromthe block number for heap). A relative path from PGPATH is used.- The block number of the broken page.By default, only superusers have an access to this function butexecution rights can be granted to other users.The feature introduced here is still minimal, and more improvementscould be done, like:- Addition of a start and end block number to run checks on a rangeof blocks, which would apply only if one fork type is checked.- Addition of some progress reporting.- Throttling, with configuration parameters in function input orpotentially some cost-based GUCs.Regression tests are added for positive cases in the main regressiontest suite, and TAP tests are added for cases involving the emulation ofpage corruptions.Bump catalog version.Author: Julien Rouhaud, Michael PaquierReviewed-by: Masahiko Sawada, Justin PryzbyDiscussion:https://postgr.es/m/CAOBaU_aVvMjQn=ge5qPiJOPMmOj5=ii3st5Q0Y+WuLML5sR17w@mail.gmail.com1 parentc780a7a commitf2b8839
File tree
12 files changed
+644
-2
lines changed- doc/src/sgml
- src
- backend
- catalog
- utils/adt
- include/catalog
- test
- recovery/t
- regress
- expected
- sql
- tools/pgindent
12 files changed
+644
-2
lines changedLines changed: 50 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
26182 | 26182 |
| |
26183 | 26183 |
| |
26184 | 26184 |
| |
| 26185 | + | |
| 26186 | + | |
| 26187 | + | |
| 26188 | + | |
| 26189 | + | |
| 26190 | + | |
| 26191 | + | |
| 26192 | + | |
| 26193 | + | |
| 26194 | + | |
| 26195 | + | |
| 26196 | + | |
| 26197 | + | |
| 26198 | + | |
| 26199 | + | |
| 26200 | + | |
| 26201 | + | |
| 26202 | + | |
| 26203 | + | |
| 26204 | + | |
| 26205 | + | |
| 26206 | + | |
| 26207 | + | |
| 26208 | + | |
| 26209 | + | |
| 26210 | + | |
| 26211 | + | |
| 26212 | + | |
| 26213 | + | |
| 26214 | + | |
| 26215 | + | |
| 26216 | + | |
| 26217 | + | |
| 26218 | + | |
| 26219 | + | |
| 26220 | + | |
| 26221 | + | |
| 26222 | + | |
| 26223 | + | |
| 26224 | + | |
| 26225 | + | |
| 26226 | + | |
| 26227 | + | |
| 26228 | + | |
| 26229 | + | |
| 26230 | + | |
| 26231 | + | |
| 26232 | + | |
| 26233 | + | |
| 26234 | + | |
26185 | 26235 |
| |
26186 | 26236 |
| |
26187 | 26237 |
| |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1300 | 1300 |
| |
1301 | 1301 |
| |
1302 | 1302 |
| |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
1303 | 1311 |
| |
1304 | 1312 |
| |
1305 | 1313 |
| |
| |||
1444 | 1452 |
| |
1445 | 1453 |
| |
1446 | 1454 |
| |
| 1455 | + | |
1447 | 1456 |
| |
1448 | 1457 |
| |
1449 | 1458 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
69 | 69 |
| |
70 | 70 |
| |
71 | 71 |
| |
| 72 | + | |
72 | 73 |
| |
73 | 74 |
| |
74 | 75 |
| |
|
Lines changed: 229 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 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + |
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
53 | 53 |
| |
54 | 54 |
| |
55 | 55 |
| |
56 |
| - | |
| 56 | + | |
57 | 57 |
| |
58 | 58 |
|
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10958 | 10958 |
| |
10959 | 10959 |
| |
10960 | 10960 |
| |
| 10961 | + | |
| 10962 | + | |
| 10963 | + | |
| 10964 | + | |
| 10965 | + | |
| 10966 | + | |
| 10967 | + | |
10961 | 10968 |
| |
10962 | 10969 |
| |
10963 | 10970 |
| |
|
0 commit comments
Comments
(0)