OSDN Git Service

Write an end-of-backup WAL record at pg_stop_backup(), and wait for it at
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 4 Jan 2010 12:50:50 +0000 (12:50 +0000)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 4 Jan 2010 12:50:50 +0000 (12:50 +0000)
commit06f82b29616cd9effcaefd99c6b6e2e80697482f
treecff1098abbcdbf2ff57554fc8f976638c1fb3353
parent40608e7f949fb7e4025c0ddd5be01939adc79eec
Write an end-of-backup WAL record at pg_stop_backup(), and wait for it at
recovery instead of reading the backup history file. This is more robust,
as it stops you from prematurely starting up an inconsisten cluster if the
backup history file is lost for some reason, or if the base backup was
never finished with pg_stop_backup().

This also paves the way for a simpler streaming replication patch, which
doesn't need to care about backup history files anymore.

The backup history file is still created and archived as before, but it's
not used by the system anymore. It's just for informational purposes now.

Bump PG_CONTROL_VERSION as the location of the backup startpoint is now
written to a new field in pg_control, and catversion because initdb is
required

Original patch by Fujii Masao per Simon's idea, with further fixes by me.
src/backend/access/transam/xlog.c
src/bin/pg_controldata/pg_controldata.c
src/bin/pg_resetxlog/pg_resetxlog.c
src/include/catalog/catversion.h
src/include/catalog/pg_control.h