postgresql/src
Heikki Linnakangas b2a5545bd6 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.
2015-04-13 16:53:49 +03:00
..
backend Don't archive bogus recycled or preallocated files after timeline switch. 2015-04-13 16:53:49 +03:00
bin Silence gettext warning about '\r' escape sequence in translatable string. 2015-04-13 13:30:59 +09:00
common Add palloc_extended for frontend and backend. 2015-04-03 17:36:12 +09:00
include Don't archive bogus recycled or preallocated files after timeline switch. 2015-04-13 16:53:49 +03:00
interfaces libpq: Don't overwrite existing OpenSSL thread callbacks 2015-04-09 20:45:34 -04:00
makefiles Revert haphazard pgxs makefile changes 2014-12-04 08:07:59 -05:00
pl Tweak __attribute__-wrapping macros for better pgindent results. 2015-03-26 14:03:25 -04:00
port Upgrade src/port/rint.c to be POSIX-compliant. 2015-03-25 15:54:18 -04:00
template Remove duplicate specification of -Ae for HP-UX C compiler. 2015-01-13 22:52:11 -05:00
test Add system view pg_stat_ssl 2015-04-12 19:07:46 +02:00
timezone Update time zone data files to tzdata release 2015a. 2015-01-30 22:45:44 -05:00
tools emacs: Set indent-tabs-mode in perl-mode 2015-04-12 23:53:23 -04:00
tutorial Update copyright for 2015 2015-01-06 11:43:47 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS
Makefile Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
Makefile.global.in Fix installcheck case for tap tests 2014-12-24 10:31:36 -05:00
Makefile.shlib Unlink static libraries before rebuilding them. 2015-03-01 13:05:23 -05:00
nls-global.mk Setup error context callback for transaction lock waits 2014-03-19 15:10:36 -03:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00