- Notifications
You must be signed in to change notification settings - Fork5k
Commit9de9294
committed
Stop archive recovery if WAL generated with wal_level=minimal is found.
Previously if hot standby was enabled, archive recovery exited withan error when it found WAL generated with wal_level=minimal.But if hot standby was disabled, it just reported a warning andcontinued in that case. Which could lead to data loss or errorsduring normal operation. A warning was emitted, but users couldeasily miss that and not notice this serious situation untilthey encountered the actual errors.To improve this situation, this commit changes archive recoveryso that it exits with FATAL error when it finds WAL generated withwal_level=minimal whatever the setting of hot standby. This enablesusers to notice the serious situation soon.The FATAL error is thrown if archive recovery starts from a basebackup taken before wal_level is changed to minimal. When archiverecovery exits with the error, if users have a base backup takenafter setting wal_level to higher than minimal, they can recoverthe database by starting archive recovery from that newer backup.But note that if such backup doesn't exist, there is no easy way tocomplete archive recovery, which may make the database serverunstartable and users may lose whole database. The commit addsthe note about this risk into the document.Even in the case of unstartable database server, previously by justdisabling hot standby users could avoid the error during archiverecovery, forcibly start up the server and salvage data from it.But note that this commit makes this procedure unavailable at all.Author: Takamichi OsumiReviewed-by: Laurenz Albe, Kyotaro Horiguchi, David Steele, Fujii MasaoDiscussion:https://postgr.es/m/OSBPR01MB4888CBE1DA08818FD2D90ED8EDF90@OSBPR01MB4888.jpnprd01.prod.outlook.com1 parentc4c393b commit9de9294
File tree
4 files changed
+106
-9
lines changed- doc/src/sgml
- src
- backend/access/transam
- test/recovery/t
4 files changed
+106
-9
lines changedLines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2720 | 2720 |
| |
2721 | 2721 |
| |
2722 | 2722 |
| |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
2723 | 2727 |
| |
2724 | 2728 |
| |
2725 | 2729 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1745 | 1745 |
| |
1746 | 1746 |
| |
1747 | 1747 |
| |
1748 |
| - | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
1749 | 1751 |
| |
1750 | 1752 |
| |
1751 | 1753 |
| |
|
Lines changed: 4 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6403 | 6403 |
| |
6404 | 6404 |
| |
6405 | 6405 |
| |
6406 |
| - | |
6407 |
| - | |
6408 |
| - | |
| 6406 | + | |
| 6407 | + | |
| 6408 | + | |
| 6409 | + | |
6409 | 6410 |
| |
6410 | 6411 |
| |
6411 | 6412 |
| |
| |||
6414 | 6415 |
| |
6415 | 6416 |
| |
6416 | 6417 |
| |
6417 |
| - | |
6418 |
| - | |
6419 |
| - | |
6420 |
| - | |
6421 |
| - | |
6422 | 6418 |
| |
6423 | 6419 |
| |
6424 | 6420 |
| |
|
Lines changed: 95 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 | + |
0 commit comments
Comments
(0)