postgresql/src/include/access
Heikki Linnakangas abfd192b1b Allow a streaming replication standby to follow a timeline switch.
Before this patch, streaming replication would refuse to start replicating
if the timeline in the primary doesn't exactly match the standby. The
situation where it doesn't match is when you have a master, and two
standbys, and you promote one of the standbys to become new master.
Promoting bumps up the timeline ID, and after that bump, the other standby
would refuse to continue.

There's significantly more timeline related logic in streaming replication
now. First of all, when a standby connects to primary, it will ask the
primary for any timeline history files that are missing from the standby.
The missing files are sent using a new replication command TIMELINE_HISTORY,
and stored in standby's pg_xlog directory. Using the timeline history files,
the standby can follow the latest timeline present in the primary
(recovery_target_timeline='latest'), just as it can follow new timelines
appearing in an archive directory.

START_REPLICATION now takes a TIMELINE parameter, to specify exactly which
timeline to stream WAL from. This allows the standby to request the primary
to send over WAL that precedes the promotion. The replication protocol is
changed slightly (in a backwards-compatible way although there's little hope
of streaming replication working across major versions anyway), to allow
replication to stop when the end of timeline reached, putting the walsender
back into accepting a replication command.

Many thanks to Amit Kapila for testing and reviewing various versions of
this patch.
2012-12-13 19:17:32 +02:00
..
attnum.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
clog.h Make the number of CLOG buffers adaptive, based on shared_buffers. 2012-01-06 14:32:18 -05:00
genam.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
gin.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
gin_private.h Replace int2/int4 in C code with int16/int32 2012-06-25 01:51:46 +03:00
gist.h Assorted comment fixes, mostly just typos, but some obsolete statements. 2012-01-29 19:23:56 -05:00
gist_private.h Fix multiple problems in WAL replay. 2012-11-12 22:05:53 -05:00
gistscan.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
hash.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
heapam.h Reduce scope of changes for COPY FREEZE. 2012-12-02 20:52:52 +00:00
heapam_xlog.h Split tuple struct defs from htup.h to htup_details.h 2012-08-30 16:52:35 -04:00
hio.h Make include files work without having to include other ones first 2012-06-10 12:46:14 +03:00
htup.h Split tuple struct defs from htup.h to htup_details.h 2012-08-30 16:52:35 -04:00
htup_details.h Split tuple struct defs from htup.h to htup_details.h 2012-08-30 16:52:35 -04:00
itup.h Lots of doc corrections. 2012-04-23 22:43:09 -04:00
multixact.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
nbtree.h Fix btmarkpos/btrestrpos to handle array keys. 2012-09-27 17:01:02 -04:00
printtup.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
reloptions.h Split tuple struct defs from htup.h to htup_details.h 2012-08-30 16:52:35 -04:00
relscan.h Split tuple struct defs from htup.h to htup_details.h 2012-08-30 16:52:35 -04:00
rewriteheap.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
rmgr.h Add SP-GiST (space-partitioned GiST) index access method. 2011-12-17 16:42:30 -05:00
sdir.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
skey.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
slru.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
spgist.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
spgist_private.h Trim spgist_private.h inclusion 2012-09-05 11:06:51 -03:00
subtrans.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
sysattr.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
timeline.h Allow a streaming replication standby to follow a timeline switch. 2012-12-13 19:17:32 +02:00
transam.h Replace XLogRecPtr struct with a 64-bit integer. 2012-06-24 19:19:45 +03:00
tupconvert.h Split tuple struct defs from htup.h to htup_details.h 2012-08-30 16:52:35 -04:00
tupdesc.h Recast "ONLY" column CHECK constraints as NO INHERIT 2012-04-20 23:56:57 -03:00
tupmacs.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
tuptoaster.h Split tuple struct defs from htup.h to htup_details.h 2012-08-30 16:52:35 -04:00
twophase.h Tighten up includes in sinvaladt.h, twophase.h, proc.h 2012-06-25 18:40:40 -04:00
twophase_rmgr.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
valid.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
visibilitymap.h Prevent index-only scans from returning wrong answers under Hot Standby. 2012-04-26 20:00:21 -04:00
xact.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
xlog.h Allow a streaming replication standby to follow a timeline switch. 2012-12-13 19:17:32 +02:00
xlog_fn.h Make xlog_internal.h includable in frontend context. 2012-12-13 14:59:13 +02:00
xlog_internal.h Make xlog_internal.h includable in frontend context. 2012-12-13 14:59:13 +02:00
xlogdefs.h Replace XLogRecPtr struct with a 64-bit integer. 2012-06-24 19:19:45 +03:00
xlogutils.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00