*
*
* 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:
*/
if (SharedBufferChanged)
{
- FlushBufferPool(!TransactionFlushEnabled());
+ FlushBufferPool();
if (leak)
ResetBufferPool();
* Now write the log info to the disk too.
*/
leak = BufferPoolCheckLeak();
- FlushBufferPool(!TransactionFlushEnabled());
+ FlushBufferPool();
}
if (leak)
#include <unistd.h>
#include <errno.h>
#include <sys/stat.h>
+#include <sys/time.h>
#include "postgres.h"
#include "access/xlog.h"
/* 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;
checkPoint.nextOid = ShmemVariableCache->nextOid;
SpinRelease(OidGenLockId);
- FlushBufferPool(false);
+ FlushBufferPool();
/* Get UNDO record ptr */
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
* flush buffers and record status of current transaction as
* committed, and continue. - vadim 11/13/96
*/
- FlushBufferPool(!TransactionFlushEnabled());
+ FlushBufferPool();
TransactionIdCommit(myXID);
- FlushBufferPool(!TransactionFlushEnabled());
+ FlushBufferPool();
}
/*
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)
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
* ------------------------------------------------
*/
void
-FlushBufferPool(int StableMainMemoryFlag)
+FlushBufferPool(void)
{
- if (!StableMainMemoryFlag)
- {
- BufferSync();
- smgrcommit();
- }
+ BufferSync();
+ smgrcommit();
}
/*
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
int
mdcommit()
{
+#ifdef XLOG
+ sync();
+ sleep(1);
+ sync();
+ return SM_SUCCESS;
+#else
int i;
MdfdVec *v;
}
return SM_SUCCESS;
+#endif /* XLOG */
}
/*
*
*
* 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
*/
InitLocalBuffer();
+#ifndef XLOG
if (!TransactionFlushEnabled())
on_shmem_exit(FlushBufferPool, (caddr_t) NULL);
+#endif
/* ----------------
* initialize the database id used for system caches and lock tables
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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,