- Notifications
You must be signed in to change notification settings - Fork5
Commit41f9ffd
committed
If backup-end record is not seen, and we reach end of recovery from a
streamed backup, throw an error and refuse to start up. The restore has notfinished correctly in that case and the data directory is possibly corrupt.We already errored out in case of archive recovery, but could not duringcrash recovery because we couldn't distinguish between the case thatpg_start_backup() was called and the database then crashed (must not error,data is OK), and the case that we're restoring from a backup and not allthe needed WAL was replayed (data can be corrupt).To distinguish those cases, add a line to backup_label to indicatewhether the backup was taken with pg_start/stop_backup(), or by streaming(ie. pg_basebackup).This requires re-initdb, because of a new field added to the control file.1 parent9f17ffd commit41f9ffd
File tree
2 files changed
+41
-7
lines changed- src
- backend/access/transam
- include/catalog
2 files changed
+41
-7
lines changedLines changed: 33 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
662 | 662 |
| |
663 | 663 |
| |
664 | 664 |
| |
665 |
| - | |
| 665 | + | |
| 666 | + | |
666 | 667 |
| |
667 | 668 |
| |
668 | 669 |
| |
| |||
6016 | 6017 |
| |
6017 | 6018 |
| |
6018 | 6019 |
| |
| 6020 | + | |
6019 | 6021 |
| |
6020 | 6022 |
| |
6021 | 6023 |
| |
| |||
6149 | 6151 |
| |
6150 | 6152 |
| |
6151 | 6153 |
| |
6152 |
| - | |
| 6154 | + | |
6153 | 6155 |
| |
6154 | 6156 |
| |
6155 | 6157 |
| |
| |||
6328 | 6330 |
| |
6329 | 6331 |
| |
6330 | 6332 |
| |
| 6333 | + | |
6331 | 6334 |
| |
| 6335 | + | |
| 6336 | + | |
6332 | 6337 |
| |
6333 | 6338 |
| |
6334 | 6339 |
| |
| |||
6698 | 6703 |
| |
6699 | 6704 |
| |
6700 | 6705 |
| |
6701 |
| - | |
| 6706 | + | |
6702 | 6707 |
| |
6703 |
| - | |
| 6708 | + | |
| 6709 | + | |
| 6710 | + | |
| 6711 | + | |
| 6712 | + | |
6704 | 6713 |
| |
6705 | 6714 |
| |
6706 | 6715 |
| |
| |||
8531 | 8540 |
| |
8532 | 8541 |
| |
8533 | 8542 |
| |
| 8543 | + | |
8534 | 8544 |
| |
8535 | 8545 |
| |
8536 | 8546 |
| |
| |||
9013 | 9023 |
| |
9014 | 9024 |
| |
9015 | 9025 |
| |
| 9026 | + | |
| 9027 | + | |
9016 | 9028 |
| |
9017 | 9029 |
| |
9018 | 9030 |
| |
| |||
9768 | 9780 |
| |
9769 | 9781 |
| |
9770 | 9782 |
| |
9771 |
| - | |
| 9783 | + | |
| 9784 | + | |
9772 | 9785 |
| |
9773 | 9786 |
| |
9774 |
| - | |
| 9787 | + | |
9775 | 9788 |
| |
9776 | 9789 |
| |
9777 | 9790 |
| |
9778 | 9791 |
| |
9779 | 9792 |
| |
| 9793 | + | |
| 9794 | + | |
| 9795 | + | |
9780 | 9796 |
| |
9781 | 9797 |
| |
9782 | 9798 |
| |
| |||
9809 | 9825 |
| |
9810 | 9826 |
| |
9811 | 9827 |
| |
| 9828 | + | |
| 9829 | + | |
| 9830 | + | |
| 9831 | + | |
| 9832 | + | |
| 9833 | + | |
| 9834 | + | |
| 9835 | + | |
| 9836 | + | |
| 9837 | + | |
| 9838 | + | |
9812 | 9839 |
| |
9813 | 9840 |
| |
9814 | 9841 |
| |
|
Lines changed: 8 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
24 |
| - | |
| 24 | + | |
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
| |||
137 | 137 |
| |
138 | 138 |
| |
139 | 139 |
| |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
140 | 146 |
| |
141 | 147 |
| |
142 | 148 |
| |
| 149 | + | |
143 | 150 |
| |
144 | 151 |
| |
145 | 152 |
| |
|
0 commit comments
Comments
(0)