forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9ecb134
committed
pg_walinspect: pg_get_wal_fpi_info() -> pg_get_wal_block_info()
This commit reworks pg_get_wal_fpi_info() to become aware of all theblock information that can be attached to a record rather than just itsfull-page writes:- Addition of the block id as assigned by XLogRegisterBuffer(),XLogRegisterBlock() or XLogRegisterBufData().- Addition of the block data, as bytea, or NULL if none. The length ofthe block data can be guessed with length(), so there is no need tostore its length in a separate field.- Addition of the full-page image length, as counted without a hole oreven compressed.- Modification of the handling of the full-page image data. This isstill a bytea, but it could become NULL if none is assigned to a block.- Addition of the full-page image flags, tracking if a page is storedwith a hole, if it needs to be applied and the type of compressionapplied to it, as of all the BKPIMAGE_* values in xlogrecord.h.The information of each block is returned as one single record, with therecord's ReadRecPtr included to be able to join the block informationwith the existing pg_get_wal_records_info(). Note that it is perfectlypossible for a block to hold both data and full-page image.Thanks also to Kyotaro Horiguchi and Matthias van de Meent for thediscussion.This commit uses some of the work proposed by Melanie, though it hasbeen largely redesigned and rewritten by me. Bharath has helped inrefining a bit the whole.Reported-by: Melanie PlagemanAuthor: Michael Paquier, Melanie Plageman, Bharath RupireddyDiscussion:https://postgr.es/m/CAAKRu_bORebdZmcV8V4cZBzU8M_C6tDDdbiPhCZ6i-iuSXW9TA@mail.gmail.com1 parent8da2ec3 commit9ecb134
File tree
5 files changed
+174
-86
lines changed- contrib/pg_walinspect
- expected
- sql
- doc/src/sgml
5 files changed
+174
-86
lines changedLines changed: 23 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
74 | 74 |
| |
75 | 75 |
| |
76 | 76 |
| |
77 |
| - | |
| 77 | + | |
78 | 78 |
| |
| 79 | + | |
79 | 80 |
| |
80 |
| - | |
81 |
| - | |
82 |
| - | |
83 |
| - | |
| 81 | + | |
84 | 82 |
| |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
85 | 96 |
| |
86 |
| - | |
87 |
| - | |
| 97 | + | |
| 98 | + | |
88 | 99 |
| |
89 | 100 |
| |
90 | 101 |
| |
| |||
116 | 127 |
| |
117 | 128 |
| |
118 | 129 |
| |
119 |
| - | |
| 130 | + | |
120 | 131 |
| |
121 | 132 |
| |
122 | 133 |
| |
| |||
146 | 157 |
| |
147 | 158 |
| |
148 | 159 |
| |
149 |
| - | |
| 160 | + | |
150 | 161 |
| |
151 | 162 |
| |
152 | 163 |
| |
| |||
160 | 171 |
| |
161 | 172 |
| |
162 | 173 |
| |
163 |
| - | |
| 174 | + | |
164 | 175 |
| |
165 | 176 |
| |
166 | 177 |
| |
| |||
184 | 195 |
| |
185 | 196 |
| |
186 | 197 |
| |
187 |
| - | |
| 198 | + | |
188 | 199 |
| |
189 | 200 |
| |
190 | 201 |
| |
| |||
196 | 207 |
| |
197 | 208 |
| |
198 | 209 |
| |
199 |
| - | |
| 210 | + | |
200 | 211 |
| |
201 | 212 |
| |
202 | 213 |
| |
|
Lines changed: 10 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
7 |
| - | |
| 7 | + | |
8 | 8 |
| |
9 |
| - | |
| 9 | + | |
10 | 10 |
| |
11 | 11 |
| |
| 12 | + | |
12 | 13 |
| |
13 | 14 |
| |
14 | 15 |
| |
15 | 16 |
| |
16 | 17 |
| |
17 |
| - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
18 | 22 |
| |
19 | 23 |
| |
20 |
| - | |
| 24 | + | |
21 | 25 |
| |
22 | 26 |
| |
23 |
| - | |
24 |
| - | |
| 27 | + | |
| 28 | + |
Lines changed: 100 additions & 40 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
| 23 | + | |
23 | 24 |
| |
24 | 25 |
| |
25 | 26 |
| |
| |||
30 | 31 |
| |
31 | 32 |
| |
32 | 33 |
| |
33 |
| - | |
| 34 | + | |
34 | 35 |
| |
35 | 36 |
| |
36 | 37 |
| |
| |||
56 | 57 |
| |
57 | 58 |
| |
58 | 59 |
| |
59 |
| - | |
| 60 | + | |
60 | 61 |
| |
61 | 62 |
| |
62 | 63 |
| |
| |||
221 | 222 |
| |
222 | 223 |
| |
223 | 224 |
| |
224 |
| - | |
| 225 | + | |
| 226 | + | |
225 | 227 |
| |
226 | 228 |
| |
227 |
| - | |
| 229 | + | |
228 | 230 |
| |
229 |
| - | |
| 231 | + | |
230 | 232 |
| |
231 | 233 |
| |
232 | 234 |
| |
233 | 235 |
| |
234 | 236 |
| |
235 |
| - | |
236 |
| - | |
237 |
| - | |
238 |
| - | |
| 237 | + | |
| 238 | + | |
239 | 239 |
| |
240 | 240 |
| |
241 |
| - | |
242 |
| - | |
| 241 | + | |
| 242 | + | |
243 | 243 |
| |
244 | 244 |
| |
245 | 245 |
| |
246 | 246 |
| |
247 | 247 |
| |
248 |
| - | |
249 |
| - | |
250 |
| - | |
251 |
| - | |
252 |
| - | |
253 |
| - | |
254 |
| - | |
255 |
| - | |
256 |
| - | |
| 248 | + | |
257 | 249 |
| |
258 |
| - | |
259 | 250 |
| |
260 |
| - | |
| 251 | + | |
261 | 252 |
| |
262 | 253 |
| |
263 |
| - | |
264 |
| - | |
265 |
| - | |
266 |
| - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
267 | 259 |
| |
268 | 260 |
| |
269 | 261 |
| |
| |||
272 | 264 |
| |
273 | 265 |
| |
274 | 266 |
| |
275 |
| - | |
276 |
| - | |
277 |
| - | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
278 | 275 |
| |
279 |
| - | |
280 |
| - | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
281 | 285 |
| |
282 |
| - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
283 | 341 |
| |
284 |
| - | |
| 342 | + | |
285 | 343 |
| |
286 | 344 |
| |
287 | 345 |
| |
288 | 346 |
| |
289 | 347 |
| |
290 |
| - | |
| 348 | + | |
291 | 349 |
| |
292 | 350 |
| |
293 | 351 |
| |
294 |
| - | |
295 |
| - | |
296 |
| - | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
297 | 357 |
| |
298 | 358 |
| |
299 | 359 |
| |
300 | 360 |
| |
301 | 361 |
| |
302 |
| - | |
| 362 | + | |
303 | 363 |
| |
304 | 364 |
| |
305 | 365 |
| |
| |||
317 | 377 |
| |
318 | 378 |
| |
319 | 379 |
| |
320 |
| - | |
| 380 | + | |
321 | 381 |
| |
322 | 382 |
| |
323 | 383 |
| |
| |||
326 | 386 |
| |
327 | 387 |
| |
328 | 388 |
| |
329 |
| - | |
| 389 | + | |
330 | 390 |
| |
331 | 391 |
| |
332 | 392 |
| |
|
0 commit comments
Comments
(0)