diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
index b3bf5cd973713d4d4df782bc62ab23c87e0f34a5..dc5bbcd32eb048e31a6828a544b815c62f9d5fa2 100644
--- a/src/backend/access/transam/xact.c
+++ b/src/backend/access/transam/xact.c
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.53 1999/09/24 00:24:05 tgl Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.54 1999/09/28 11:41:03 vadim Exp $
  *
  * NOTES
  *		Transaction aborts can now occur two ways:
@@ -632,7 +632,7 @@ RecordTransactionCommit()
 	 */
 	if (SharedBufferChanged)
 	{
-		FlushBufferPool(!TransactionFlushEnabled());
+		FlushBufferPool();
 		if (leak)
 			ResetBufferPool();
 
@@ -646,7 +646,7 @@ RecordTransactionCommit()
 		 *	Now write the log info to the disk too.
 		 */
 		leak = BufferPoolCheckLeak();
-		FlushBufferPool(!TransactionFlushEnabled());
+		FlushBufferPool();
 	}
 
 	if (leak)
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index f1b80d402704e712a0ff7d34423aba750dbcf5c2..2a7d60d3aacac61e65a46dc416dd49541253b64d 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -2,6 +2,7 @@
 #include <unistd.h>
 #include <errno.h>
 #include <sys/stat.h>
+#include <sys/time.h>
 
 #include "postgres.h"
 #include "access/xlog.h"
@@ -1376,12 +1377,10 @@ CreateCheckPoint(bool shutdown)
 	/* Get REDO record ptr */
 	while (!TAS(&(XLogCtl->insert_lck)))
 	{
-		struct timeval delay;
+		struct timeval delay = {0, 5000};
 
 		if (shutdown)
 			elog(STOP, "XLog insert lock is busy while data base is shutting down");
-		delay.tv_sec = 0;
-		delay.tv_usec = 0;
 		(void) select(0, NULL, NULL, NULL, &delay);
 	}
 	freespace = ((char*) Insert->currpage) + BLCKSZ - Insert->currpos;
@@ -1408,7 +1407,7 @@ CreateCheckPoint(bool shutdown)
 	checkPoint.nextOid = ShmemVariableCache->nextOid;
 	SpinRelease(OidGenLockId);
 
-	FlushBufferPool(false);
+	FlushBufferPool();
 
 	/* Get UNDO record ptr */
 
diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c
index e5cf7b0c88aebd0334845e7a01e7748779e3f07a..62ef4028d768d460dafd3c56941b584d7fb43fd8 100644
--- a/src/backend/commands/vacuum.c
+++ b/src/backend/commands/vacuum.c
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.121 1999/09/24 00:24:17 tgl Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.122 1999/09/28 11:41:04 vadim Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1703,9 +1703,9 @@ failed to add item with len = %u to page %u (free space %u, nusd %u, noff %u)",
 		 * flush buffers and record status of current transaction as
 		 * committed, and continue. - vadim 11/13/96
 		 */
-		FlushBufferPool(!TransactionFlushEnabled());
+		FlushBufferPool();
 		TransactionIdCommit(myXID);
-		FlushBufferPool(!TransactionFlushEnabled());
+		FlushBufferPool();
 	}
 
 	/*
@@ -1899,12 +1899,10 @@ vc_vacheap(VRelStats *vacrelstats, Relation onerel, VPageList vacuum_pages)
 			 vacrelstats->num_pages, nblocks);
 
 		/*
-		 * we have to flush "empty" end-pages (if changed, but who knows
-		 * it) before truncation
-		 *
-		 * XXX wouldn't passing 'true' to FlushRelationBuffers do the job?
+		 * We have to flush "empty" end-pages (if changed, but who knows it)
+		 * before truncation
 		 */
-		FlushBufferPool(!TransactionFlushEnabled());
+		FlushBufferPool();
 
 		i = FlushRelationBuffers(onerel, nblocks, false);
 		if (i < 0)
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index e0327c678f2dab759b355998292763d2050b6890..a6f52583a0675dc3cc383b05eeed08b260e1afd8 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.63 1999/09/24 00:24:29 tgl Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.64 1999/09/28 11:41:06 vadim Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1240,13 +1240,10 @@ relname=%s, blockNum=%d, flags=0x%x, refcount=%d %d)",
  * ------------------------------------------------
  */
 void
-FlushBufferPool(int StableMainMemoryFlag)
+FlushBufferPool(void)
 {
-	if (!StableMainMemoryFlag)
-	{
-		BufferSync();
-		smgrcommit();
-	}
+	BufferSync();
+	smgrcommit();
 }
 
 /*
diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c
index 444181a938a78ba63f793c5959bf6b0e146789f3..a2c102145b88c23a4c2c5e35c61679a1bc6093ee 100644
--- a/src/backend/storage/smgr/md.c
+++ b/src/backend/storage/smgr/md.c
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.54 1999/09/24 00:24:47 tgl Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.55 1999/09/28 11:41:07 vadim Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -815,6 +815,12 @@ mdtruncate(Relation reln, int nblocks)
 int
 mdcommit()
 {
+#ifdef XLOG
+	sync();
+	sleep(1);
+	sync();
+	return SM_SUCCESS;
+#else
 	int			i;
 	MdfdVec    *v;
 
@@ -838,6 +844,7 @@ mdcommit()
 	}
 
 	return SM_SUCCESS;
+#endif	/* XLOG */
 }
 
 /*
diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c
index 51d4727fe35a726d4bae9faea13eca53456ec21e..1285c23e8434680ce476567504998507d8dacccc 100644
--- a/src/backend/utils/init/postinit.c
+++ b/src/backend/utils/init/postinit.c
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.49 1999/09/24 00:24:58 tgl Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.50 1999/09/28 11:41:09 vadim Exp $
  *
  * NOTES
  *		InitPostgres() is the function called from PostgresMain
@@ -541,8 +541,10 @@ InitPostgres(char *name)		/* database name */
 	 */
 	InitLocalBuffer();
 
+#ifndef XLOG
 	if (!TransactionFlushEnabled())
 		on_shmem_exit(FlushBufferPool, (caddr_t) NULL);
+#endif
 
 	/* ----------------
 	 *	initialize the database id used for system caches and lock tables
diff --git a/src/include/storage/bufmgr.h b/src/include/storage/bufmgr.h
index fb901b8f442108e51ae943aae540d30ba5e47de4..fcf9e730ac70fc9db143fab5bd893fe324e67fec 100644
--- a/src/include/storage/bufmgr.h
+++ b/src/include/storage/bufmgr.h
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: bufmgr.h,v 1.31 1999/09/24 00:25:27 tgl Exp $
+ * $Id: bufmgr.h,v 1.32 1999/09/28 11:40:53 vadim Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -170,7 +170,7 @@ extern void PrintBufferUsage(FILE *statfp);
 extern void ResetBufferUsage(void);
 extern void ResetBufferPool(void);
 extern int	BufferPoolCheckLeak(void);
-extern void FlushBufferPool(int StableMainMemoryFlag);
+extern void FlushBufferPool(void);
 extern BlockNumber BufferGetBlockNumber(Buffer buffer);
 extern BlockNumber RelationGetNumberOfBlocks(Relation relation);
 extern int	FlushRelationBuffers(Relation rel, BlockNumber block,