aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gin
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-08-07 16:57:57 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-08-07 16:57:57 +0000
commite002836913ce69ca3e501a6d2c42296f1d103998 (patch)
treec678bfba6916c7daa85c38f659cccae629867aac /src/backend/access/gin
parent977ac90001c0188289f3b20eac3720fc6b26f180 (diff)
downloadpostgresql-e002836913ce69ca3e501a6d2c42296f1d103998.tar.gz
postgresql-e002836913ce69ca3e501a6d2c42296f1d103998.zip
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/backend/access/gin')
-rw-r--r--src/backend/access/gin/ginxlog.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/backend/access/gin/ginxlog.c b/src/backend/access/gin/ginxlog.c
index a3387422418..265e7de70c4 100644
--- a/src/backend/access/gin/ginxlog.c
+++ b/src/backend/access/gin/ginxlog.c
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/gin/ginxlog.c,v 1.3 2006/07/14 14:52:16 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/access/gin/ginxlog.c,v 1.4 2006/08/07 16:57:56 tgl Exp $
*-------------------------------------------------------------------------
*/
#include "postgres.h"
@@ -528,7 +528,8 @@ gin_xlog_cleanup(void) {
topCtx = MemoryContextSwitchTo(opCtx);
- foreach(l, incomplete_splits) {
+ foreach(l, incomplete_splits)
+ {
ginIncompleteSplit *split = (ginIncompleteSplit *) lfirst(l);
ginContinueSplit( split );
MemoryContextReset( opCtx );
@@ -538,3 +539,10 @@ gin_xlog_cleanup(void) {
MemoryContextDelete(opCtx);
}
+bool
+gin_safe_restartpoint(void)
+{
+ if (incomplete_splits)
+ return false;
+ return true;
+}