mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-17 19:30:00 +08:00
Make tree compilable (+WAL).
This commit is contained in:
parent
539b6304b3
commit
3fea625e9d
@ -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)
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -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 */
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user