aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-08-30 03:50:24 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-08-30 03:50:24 +0000
commit09c6ac951335cbcf7954d109ee77d6557466224f (patch)
treefaaf6d26e9e888900b60e029ef056df27b1d340a
parent3afd7eaffde77fd2af69f8f6512056956fd27a85 (diff)
downloadpostgresql-09c6ac951335cbcf7954d109ee77d6557466224f.tar.gz
postgresql-09c6ac951335cbcf7954d109ee77d6557466224f.zip
Dept. of second thoughts: it'd be a good idea to flush buffers
during replay of CREATE DATABASE as well as the first time around. Else it's possible that the copy operation will copy obsolete blocks. We are still a long way from guaranteeing anything about using a recently-written database as a CREATE template, but this seems needed to ensure the existing behavior holds up during replay.
-rw-r--r--src/backend/commands/dbcommands.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index 38696cf7070..1c9425789aa 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.143 2004/08/30 02:54:38 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.144 2004/08/30 03:50:24 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1136,6 +1136,13 @@ dbase_redo(XLogRecPtr lsn, XLogRecord *record)
dst_path)));
}
+ /*
+ * Force dirty buffers out to disk, to ensure source database is
+ * up-to-date for the copy. (We really only need to flush buffers for
+ * the source database...)
+ */
+ BufferSync(-1, -1);
+
#ifndef WIN32
/*