diff options
| author | Tom Lane | 2006-08-07 16:57:57 +0000 |
|---|---|---|
| committer | Tom Lane | 2006-08-07 16:57:57 +0000 |
| commit | e002836913ce69ca3e501a6d2c42296f1d103998 (patch) | |
| tree | c678bfba6916c7daa85c38f659cccae629867aac /src/include | |
| parent | 977ac90001c0188289f3b20eac3720fc6b26f180 (diff) | |
Make recovery from WAL be restartable, by executing a checkpoint-like
operation every so often. This improves the usefulness of PITR log
shipping for hot standby: formerly, if the standby server crashed, it
was necessary to restart it from the last base backup and replay all
the WAL since then. Now it will only need to reread about the same
amount of WAL as the master server would. The behavior might also
come in handy during a long PITR replay sequence. Simon Riggs,
with some editorialization by Tom Lane.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/access/gin.h | 3 | ||||
| -rw-r--r-- | src/include/access/gist_private.h | 3 | ||||
| -rw-r--r-- | src/include/access/nbtree.h | 3 | ||||
| -rw-r--r-- | src/include/access/xlog_internal.h | 3 | ||||
| -rw-r--r-- | src/include/catalog/pg_control.h | 9 |
5 files changed, 14 insertions, 7 deletions
diff --git a/src/include/access/gin.h b/src/include/access/gin.h index ba7d15cf1fc..64aef37a94c 100644 --- a/src/include/access/gin.h +++ b/src/include/access/gin.h @@ -3,7 +3,7 @@ * header file for postgres inverted index access method implementation. * * Copyright (c) 2006, PostgreSQL Global Development Group - * $PostgreSQL: pgsql/src/include/access/gin.h,v 1.5 2006/07/11 16:55:34 teodor Exp $ + * $PostgreSQL: pgsql/src/include/access/gin.h,v 1.6 2006/08/07 16:57:57 tgl Exp $ *-------------------------------------------------------------------------- */ @@ -234,6 +234,7 @@ extern void gin_redo(XLogRecPtr lsn, XLogRecord *record); extern void gin_desc(StringInfo buf, uint8 xl_info, char *rec); extern void gin_xlog_startup(void); extern void gin_xlog_cleanup(void); +extern bool gin_safe_restartpoint(void); /* ginbtree.c */ diff --git a/src/include/access/gist_private.h b/src/include/access/gist_private.h index d6e5cf0603e..de917c8b834 100644 --- a/src/include/access/gist_private.h +++ b/src/include/access/gist_private.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/access/gist_private.h,v 1.22 2006/07/11 21:05:57 tgl Exp $ + * $PostgreSQL: pgsql/src/include/access/gist_private.h,v 1.23 2006/08/07 16:57:57 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -251,6 +251,7 @@ extern void gist_redo(XLogRecPtr lsn, XLogRecord *record); extern void gist_desc(StringInfo buf, uint8 xl_info, char *rec); extern void gist_xlog_startup(void); extern void gist_xlog_cleanup(void); +extern bool gist_safe_restartpoint(void); extern IndexTuple gist_form_invalid_tuple(BlockNumber blkno); extern XLogRecData *formUpdateRdata(RelFileNode node, Buffer buffer, diff --git a/src/include/access/nbtree.h b/src/include/access/nbtree.h index 232cbb92bdb..e460bbb0d50 100644 --- a/src/include/access/nbtree.h +++ b/src/include/access/nbtree.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/access/nbtree.h,v 1.102 2006/07/25 19:13:00 tgl Exp $ + * $PostgreSQL: pgsql/src/include/access/nbtree.h,v 1.103 2006/08/07 16:57:57 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -545,5 +545,6 @@ extern void btree_redo(XLogRecPtr lsn, XLogRecord *record); extern void btree_desc(StringInfo buf, uint8 xl_info, char *rec); extern void btree_xlog_startup(void); extern void btree_xlog_cleanup(void); +extern bool btree_safe_restartpoint(void); #endif /* NBTREE_H */ diff --git a/src/include/access/xlog_internal.h b/src/include/access/xlog_internal.h index 6aeda55429d..03bf0e86231 100644 --- a/src/include/access/xlog_internal.h +++ b/src/include/access/xlog_internal.h @@ -11,7 +11,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/access/xlog_internal.h,v 1.14 2006/08/06 03:53:44 tgl Exp $ + * $PostgreSQL: pgsql/src/include/access/xlog_internal.h,v 1.15 2006/08/07 16:57:57 tgl Exp $ */ #ifndef XLOG_INTERNAL_H #define XLOG_INTERNAL_H @@ -232,6 +232,7 @@ typedef struct RmgrData void (*rm_desc) (StringInfo buf, uint8 xl_info, char *rec); void (*rm_startup) (void); void (*rm_cleanup) (void); + bool (*rm_safe_restartpoint) (void); } RmgrData; extern const RmgrData RmgrTable[]; diff --git a/src/include/catalog/pg_control.h b/src/include/catalog/pg_control.h index 86722953dda..8e405f607eb 100644 --- a/src/include/catalog/pg_control.h +++ b/src/include/catalog/pg_control.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/catalog/pg_control.h,v 1.30 2006/08/06 03:53:44 tgl Exp $ + * $PostgreSQL: pgsql/src/include/catalog/pg_control.h,v 1.31 2006/08/07 16:57:57 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -22,7 +22,7 @@ /* Version identifier for this pg_control format */ -#define PG_CONTROL_VERSION 820 +#define PG_CONTROL_VERSION 821 /* * Body of CheckPoint XLOG records. This is declared here because we keep @@ -56,7 +56,8 @@ typedef enum DBState DB_STARTUP = 0, DB_SHUTDOWNED, DB_SHUTDOWNING, - DB_IN_RECOVERY, + DB_IN_CRASH_RECOVERY, + DB_IN_ARCHIVE_RECOVERY, DB_IN_PRODUCTION } DBState; @@ -107,6 +108,8 @@ typedef struct ControlFileData CheckPoint checkPointCopy; /* copy of last check point record */ + XLogRecPtr minRecoveryPoint; /* must replay xlog to here */ + /* * This data is used to check for hardware-architecture compatibility of * the database and the backend executable. We need not check endianness |
