postgresql/src
Heikki Linnakangas b0daba57bb Tolerate timeline switches while "pg_basebackup -X fetch" is running.
If you take a base backup from a standby server with "pg_basebackup -X
fetch", and the timeline switches while the backup is being taken, the
backup used to fail with an error "requested WAL segment %s has already
been removed". This is because the server-side code that sends over the
required WAL files would not construct the WAL filename with the correct
timeline after a switch.

Fix that by using readdir() to scan pg_xlog for all the WAL segments in the
range, regardless of timeline.

Also, include all timeline history files in the backup, if taken with
"-X fetch". That fixes another related bug: If a timeline switch happened
just before the backup was initiated in a standby, the WAL segment
containing the initial checkpoint record contains WAL from the older
timeline too. Recovery will not accept that without a timeline history file
that lists the older timeline.

Backpatch to 9.2. Versions prior to that were not affected as you could not
take a base backup from a standby before 9.2.
2013-01-03 19:51:00 +02:00
..
backend Tolerate timeline switches while "pg_basebackup -X fetch" is running. 2013-01-03 19:51:00 +02:00
bin Move tar function headers to pgtar.h 2013-01-02 20:34:08 +01:00
include Tolerate timeline switches while "pg_basebackup -X fetch" is running. 2013-01-03 19:51:00 +02:00
interfaces Update copyrights for 2013 2013-01-01 17:15:01 -05:00
makefiles Remove allow_nonpic_in_shlib 2012-12-18 01:13:59 -05:00
pl Update copyrights for 2013 2013-01-01 17:15:01 -05:00
port Move tar function headers to pgtar.h 2013-01-02 20:34:08 +01:00
template Remove _FORTIFY_SOURCE 2012-10-10 21:42:38 -04:00
test Update copyrights for 2013 2013-01-01 17:15:01 -05:00
timezone Update copyrights for 2013 2013-01-01 17:15:01 -05:00
tools Update copyrights for 2013 2013-01-01 17:15:01 -05:00
tutorial Update copyrights for 2013 2013-01-01 17:15:01 -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 Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Fix some oversights in distprep and maintainer-clean targets. 2011-03-10 00:04:05 -05:00
Makefile.global.in Add mode where contrib installcheck runs each module in a separately named database. 2012-12-11 11:52:45 -05:00
Makefile.shlib Remove configure flag --disable-shared, as it is no longer used by any 2012-08-30 16:26:53 -04:00
nls-global.mk NLS: Use msgmerge --previous option 2012-12-13 23:12:12 -05:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00