aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_rewind/t/002_databases.pl
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2015-04-13 16:53:49 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2015-04-13 16:53:49 +0300
commitb2a5545bd63fc94a71b1e97ecdd03c605d97a438 (patch)
treed9867d3a75259a77d5edfcb12433f9b47d6485cd /src/bin/pg_rewind/t/002_databases.pl
parent1f94bec7a9e3e6b4fa5468236cf531fec16d1093 (diff)
downloadpostgresql-b2a5545bd63fc94a71b1e97ecdd03c605d97a438.tar.gz
postgresql-b2a5545bd63fc94a71b1e97ecdd03c605d97a438.zip
Don't archive bogus recycled or preallocated files after timeline switch.
After a timeline switch, we would leave behind recycled WAL segments that are in the future, but on the old timeline. After promotion, and after they become old enough to be recycled again, we would notice that they don't have a .ready or .done file, create a .ready file for them, and archive them. That's bogus, because the files contain garbage, recycled from an older timeline (or prealloced as zeros). We shouldn't archive such files. This could happen when we're following a timeline switch during replay, or when we switch to new timeline at end-of-recovery. To fix, whenever we switch to a new timeline, scan the data directory for WAL segments on the old timeline, but with a higher segment number, and remove them. Those don't belong to our timeline history, and are most likely bogus recycled or preallocated files. They could also be valid files that we streamed from the primary ahead of time, but in any case, they're not needed to recover to the new timeline.
Diffstat (limited to 'src/bin/pg_rewind/t/002_databases.pl')
0 files changed, 0 insertions, 0 deletions