forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitef34ab4
committed
Avoid assertion failure with targeted recovery in standby mode.
At the end of recovery, standby mode is turned off to re-fetch the lastvalid record from archive or pg_wal. Previously, if recovery target wasreached and standby mode was turned off while the current WAL sourcewas stream, recovery could try to retrieve WAL file containing the lastvalid record unexpectedly from stream even though not in standby mode.This caused an assertion failure. That is, the assertion test confirms thatWAL file should not be retrieved from stream if standby mode is not true.This commit moves back the current WAL source to archive if it's streameven though not in standby mode, to avoid that assertion failure.This issue doesn't cause the server to crash when built with assertiondisabled. In this case, the attempt to retrieve WAL file from stream notin standby mode just fails. And then recovery tries to retrieve WAL filefrom archive or pg_wal.Back-patch to all supported branches.Author: Kyotaro HoriguchiReviewed-by: Fujii MasaoDiscussion:https://postgr.es/m/20200227.124830.2197604521555566121.horikyota.ntt@gmail.com1 parentd924944 commitef34ab4
1 file changed
+22
-1
lines changedLines changed: 22 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7392 | 7392 |
| |
7393 | 7393 |
| |
7394 | 7394 |
| |
| 7395 | + | |
| 7396 | + | |
| 7397 | + | |
7395 | 7398 |
| |
| 7399 | + | |
7396 | 7400 |
| |
7397 | 7401 |
| |
7398 | 7402 |
| |
| |||
11855 | 11859 |
| |
11856 | 11860 |
| |
11857 | 11861 |
| |
| 11862 | + | |
| 11863 | + | |
| 11864 | + | |
| 11865 | + | |
| 11866 | + | |
| 11867 | + | |
| 11868 | + | |
11858 | 11869 |
| |
11859 | 11870 |
| |
11860 | 11871 |
| |
11861 | 11872 |
| |
11862 |
| - | |
| 11873 | + | |
| 11874 | + | |
| 11875 | + | |
| 11876 | + | |
11863 | 11877 |
| |
| 11878 | + | |
11864 | 11879 |
| |
11865 | 11880 |
| |
11866 | 11881 |
| |
| |||
12054 | 12069 |
| |
12055 | 12070 |
| |
12056 | 12071 |
| |
| 12072 | + | |
| 12073 | + | |
| 12074 | + | |
| 12075 | + | |
| 12076 | + | |
| 12077 | + | |
12057 | 12078 |
| |
12058 | 12079 |
| |
12059 | 12080 |
| |
|
0 commit comments
Comments
(0)