forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0d8c9c1
committed
Generate backup manifests for base backups, and validate them.
A manifest is a JSON document which includes (1) the file name, size,last modification time, and an optional checksum for each file backedup, (2) timelines and LSNs for whatever WAL will need to be replayedto make the backup consistent, and (3) a checksum for the manifestitself. By default, we use CRC-32C when checksumming data files,because we are trying to detect corruption and user error, not foil anadversary. However, pg_basebackup and the server-side BASE_BACKUPcommand now have options to select a different algorithm, so userswanting a cryptographic hash function can select SHA-224, SHA-256,SHA-384, or SHA-512. Users not wanting file checksums at all candisable them, or disable generating of the backup manifest altogether.Using a cryptographic hash function in place of CRC-32C consumessignificantly more CPU cycles, which may slow down backups in somecases.A new tool called pg_validatebackup can validate a backup against themanifest. If no checksums are present, it can still check that theright files exist and that they have the expected sizes. If checksumsare present, it can also verify that each file has the expectedchecksum. Additionally, it calls pg_waldump to verify that theexpected WAL files are present and parseable. Only plain formatbackups can be validated directly, but tar format backups can bevalidated after extracting them.Robert Haas, with help, ideas, review, and testing from David Steele,Stephen Frost, Andrew Dunstan, Rushabh Lathia, Suraj Kharage, TusharAhuja, Rajkumar Raghuwanshi, Mark Dilger, Davinder Singh, JeevanChalke, Amit Kapila, Andres Freund, and Noah Misch.Discussion:http://postgr.es/m/CA+TgmoZV8dw1H2bzZ9xkKwdrk8+XYa+DC9H=F7heO2zna5T6qg@mail.gmail.com1 parentce77abe commit0d8c9c1
File tree
27 files changed
+3614
-32
lines changed- doc/src/sgml
- ref
- src
- backend
- access/transam
- replication
- bin
- pg_basebackup
- t
- pg_validatebackup
- t
- include/replication
27 files changed
+3614
-32
lines changedLines changed: 36 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2466 | 2466 |
| |
2467 | 2467 |
| |
2468 | 2468 |
| |
2469 |
| - | |
| 2469 | + | |
2470 | 2470 |
| |
2471 | 2471 |
| |
2472 | 2472 |
| |
| |||
2576 | 2576 |
| |
2577 | 2577 |
| |
2578 | 2578 |
| |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
| 2587 | + | |
| 2588 | + | |
| 2589 | + | |
| 2590 | + | |
| 2591 | + | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
| 2596 | + | |
| 2597 | + | |
| 2598 | + | |
| 2599 | + | |
| 2600 | + | |
| 2601 | + | |
| 2602 | + | |
| 2603 | + | |
| 2604 | + | |
| 2605 | + | |
| 2606 | + | |
| 2607 | + | |
| 2608 | + | |
| 2609 | + | |
| 2610 | + | |
| 2611 | + | |
| 2612 | + | |
| 2613 | + | |
2579 | 2614 |
| |
2580 | 2615 |
| |
2581 | 2616 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
211 | 211 |
| |
212 | 212 |
| |
213 | 213 |
| |
| 214 | + | |
214 | 215 |
| |
215 | 216 |
| |
216 | 217 |
| |
|
Lines changed: 64 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
561 | 561 |
| |
562 | 562 |
| |
563 | 563 |
| |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
564 | 628 |
| |
565 | 629 |
| |
566 | 630 |
| |
|
0 commit comments
Comments
(0)