- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit2c03216
committed
Revamp the WAL record format.
Each WAL record now carries information about the modified relation andblock(s) in a standardized format. That makes it easier to write tools thatneed that information, like pg_rewind, prefetching the blocks to speed uprecovery, etc.There's a whole new API for building WAL records, replacing the XLogRecDatachains used previously. The new API consists of XLogRegister* functions,which are called for each buffer and chunk of data that is added to therecord. The new API also gives more control over when a full-page image iswritten, by passing flags to the XLogRegisterBuffer function.This also simplifies the XLogReadBufferForRedo() calls. The function can digthe relation and block number from the WAL record, so they no longer need tobe passed as arguments.For the convenience of redo routines, XLogReader now disects each WAL recordafter reading it, copying the main data part and the per-block data intoMAXALIGNed buffers. The data chunks are not aligned within the WAL record,but the redo routines can assume that the pointers returned by XLogRecGet*functions are. Redo routines are now passed the XLogReaderState, whichcontains the record in the already-disected format, instead of the plainXLogRecord.The new record format also makes the fixed size XLogRecord header smaller,by removing the xl_len field. The length of the "main data" portion is nowstored at the end of the WAL record, and there's a separate header afterXLogRecord for it. The alignment padding at the end of XLogRecord is alsoremoved. This compansates for the fact that the new format would otherwisebe more bulky than the old format.Reviewed by Andres Freund, Amit Kapila, Michael Paquier, Alvaro Herrera,Fujii Masao.1 parent8dc626d commit2c03216
File tree
93 files changed
+3945
-4366
lines changed- contrib/pg_xlogdump
- src
- backend
- access
- brin
- gin
- gist
- hash
- heap
- nbtree
- rmgrdesc
- spgist
- transam
- catalog
- commands
- replication
- logical
- storage/ipc
- utils/cache
- bin/pg_resetxlog
- include
- access
- catalog
- commands
- replication
- storage
- utils
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
93 files changed
+3945
-4366
lines changedLines changed: 78 additions & 50 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
| 20 | + | |
20 | 21 |
| |
21 | 22 |
| |
22 | 23 |
| |
| |||
343 | 344 |
| |
344 | 345 |
| |
345 | 346 |
| |
346 |
| - | |
| 347 | + | |
| 348 | + | |
347 | 349 |
| |
348 | 350 |
| |
349 | 351 |
| |
| 352 | + | |
| 353 | + | |
350 | 354 |
| |
351 | 355 |
| |
352 | 356 |
| |
353 | 357 |
| |
354 | 358 |
| |
355 |
| - | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
356 | 362 |
| |
357 | 363 |
| |
358 |
| - | |
359 |
| - | |
360 |
| - | |
361 |
| - | |
| 364 | + | |
| 365 | + | |
362 | 366 |
| |
363 | 367 |
| |
364 | 368 |
| |
365 |
| - | |
366 |
| - | |
367 |
| - | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
368 | 372 |
| |
369 | 373 |
| |
370 |
| - | |
| 374 | + | |
371 | 375 |
| |
372 | 376 |
| |
373 |
| - | |
374 |
| - | |
375 |
| - | |
376 |
| - | |
| 377 | + | |
| 378 | + | |
377 | 379 |
| |
378 | 380 |
| |
379 | 381 |
| |
380 | 382 |
| |
381 | 383 |
| |
382 | 384 |
| |
383 |
| - | |
| 385 | + | |
384 | 386 |
| |
385 |
| - | |
386 |
| - | |
387 |
| - | |
388 |
| - | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
389 | 397 |
| |
390 |
| - | |
| 398 | + | |
391 | 399 |
| |
392 |
| - | |
| 400 | + | |
393 | 401 |
| |
394 |
| - | |
395 |
| - | |
396 |
| - | |
397 |
| - | |
398 |
| - | |
399 |
| - | |
400 |
| - | |
401 |
| - | |
402 |
| - | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
403 | 407 |
| |
404 | 408 |
| |
405 | 409 |
| |
406 | 410 |
| |
407 |
| - | |
408 |
| - | |
409 |
| - | |
| 411 | + | |
410 | 412 |
| |
411 |
| - | |
412 |
| - | |
413 |
| - | |
414 |
| - | |
| 413 | + | |
| 414 | + | |
415 | 415 |
| |
416 |
| - | |
417 |
| - | |
418 |
| - | |
| 416 | + | |
419 | 417 |
| |
420 | 418 |
| |
421 |
| - | |
422 |
| - | |
423 |
| - | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
424 | 444 |
| |
425 |
| - | |
426 |
| - | |
427 |
| - | |
428 |
| - | |
429 |
| - | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
430 | 458 |
| |
431 | 459 |
| |
432 | 460 |
| |
| |||
924 | 952 |
| |
925 | 953 |
| |
926 | 954 |
| |
927 |
| - | |
| 955 | + | |
928 | 956 |
| |
929 |
| - | |
| 957 | + | |
930 | 958 |
| |
931 | 959 |
| |
932 | 960 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
16 |
| - | |
| 16 | + | |
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
|
Lines changed: 4 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
666 | 666 |
| |
667 | 667 |
| |
668 | 668 |
| |
669 |
| - | |
670 | 669 |
| |
671 | 670 |
| |
672 |
| - | |
673 | 671 |
| |
674 | 672 |
| |
675 | 673 |
| |
676 |
| - | |
677 |
| - | |
678 |
| - | |
679 |
| - | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
680 | 677 |
| |
681 |
| - | |
| 678 | + | |
682 | 679 |
| |
683 | 680 |
| |
684 | 681 |
| |
|
Lines changed: 31 additions & 66 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
140 | 140 |
| |
141 | 141 |
| |
142 | 142 |
| |
143 |
| - | |
144 | 143 |
| |
145 | 144 |
| |
146 |
| - | |
147 | 145 |
| |
148 | 146 |
| |
149 |
| - | |
150 |
| - | |
151 |
| - | |
152 |
| - | |
153 |
| - | |
154 |
| - | |
155 |
| - | |
| 147 | + | |
156 | 148 |
| |
157 |
| - | |
158 |
| - | |
159 |
| - | |
160 |
| - | |
161 |
| - | |
| 149 | + | |
| 150 | + | |
162 | 151 |
| |
163 |
| - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
164 | 156 |
| |
165 | 157 |
| |
166 | 158 |
| |
| |||
211 | 203 |
| |
212 | 204 |
| |
213 | 205 |
| |
214 |
| - | |
215 | 206 |
| |
216 | 207 |
| |
217 | 208 |
| |
218 | 209 |
| |
219 |
| - | |
220 |
| - | |
| 210 | + | |
221 | 211 |
| |
222 |
| - | |
223 |
| - | |
224 | 212 |
| |
225 |
| - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
226 | 216 |
| |
227 |
| - | |
228 |
| - | |
229 |
| - | |
230 |
| - | |
| 217 | + | |
| 218 | + | |
231 | 219 |
| |
232 |
| - | |
233 |
| - | |
234 |
| - | |
235 |
| - | |
236 |
| - | |
| 220 | + | |
| 221 | + | |
237 | 222 |
| |
238 |
| - | |
239 |
| - | |
240 |
| - | |
241 |
| - | |
242 |
| - | |
| 223 | + | |
| 224 | + | |
243 | 225 |
| |
244 |
| - | |
245 |
| - | |
246 |
| - | |
247 |
| - | |
248 |
| - | |
| 226 | + | |
| 227 | + | |
249 | 228 |
| |
250 |
| - | |
| 229 | + | |
251 | 230 |
| |
252 | 231 |
| |
253 | 232 |
| |
| |||
354 | 333 |
| |
355 | 334 |
| |
356 | 335 |
| |
357 |
| - | |
358 | 336 |
| |
359 | 337 |
| |
360 | 338 |
| |
361 |
| - | |
362 | 339 |
| |
363 | 340 |
| |
364 |
| - | |
365 |
| - | |
366 |
| - | |
367 |
| - | |
368 |
| - | |
369 |
| - | |
370 |
| - | |
371 |
| - | |
372 |
| - | |
373 |
| - | |
374 |
| - | |
375 |
| - | |
376 |
| - | |
377 |
| - | |
378 |
| - | |
379 |
| - | |
380 |
| - | |
381 |
| - | |
382 |
| - | |
383 |
| - | |
384 |
| - | |
385 |
| - | |
386 |
| - | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
387 | 352 |
| |
388 | 353 |
| |
389 | 354 |
| |
|
Lines changed: 8 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
477 | 477 |
| |
478 | 478 |
| |
479 | 479 |
| |
480 |
| - | |
481 | 480 |
| |
482 |
| - | |
483 | 481 |
| |
484 |
| - | |
485 |
| - | |
486 |
| - | |
487 |
| - | |
488 |
| - | |
489 |
| - | |
490 |
| - | |
491 |
| - | |
492 |
| - | |
493 |
| - | |
494 |
| - | |
495 |
| - | |
496 |
| - | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
497 | 490 |
| |
498 | 491 |
| |
499 | 492 |
| |
|
0 commit comments
Comments
(0)