1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-10 17:42:29 +03:00

New relcache hash table with RelFileNode as key to be used

from bufmgr - it would be nice to have separate hash in smgr
for node <--> fd mappings, but for the moment it's easy to
add new hash to relcache.
Fixed small bug in xlog.c:ReadRecord.
This commit is contained in:
Vadim B. Mikheev
2000-10-23 04:10:24 +00:00
parent c82c9559a7
commit 4b65a2840b
8 changed files with 114 additions and 101 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.74 2000/10/21 15:43:22 vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.75 2000/10/23 04:10:05 vadim Exp $
*
* NOTES
* Transaction aborts can now occur two ways:
@@ -676,6 +676,7 @@ RecordTransactionCommit()
*/
leak = BufferPoolCheckLeak();
#ifndef XLOG
/*
* If no one shared buffer was changed by this transaction then we
* don't flush shared buffers and don't record commit status.
@@ -686,6 +687,7 @@ RecordTransactionCommit()
if (leak)
ResetBufferPool(true);
#endif
/*
* have the transaction access methods record the status of this
* transaction id in the pg_log relation.
@@ -717,13 +719,14 @@ RecordTransactionCommit()
MyLastRecPtr.xlogid = 0;
MyLastRecPtr.xrecoff = 0;
}
#endif
#else
/*
* Now write the log info to the disk too.
*/
leak = BufferPoolCheckLeak();
FlushBufferPool();
}
#endif
if (leak)
ResetBufferPool(true);

View File

@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.19 2000/10/21 15:43:22 vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.20 2000/10/23 04:10:05 vadim Exp $
*
*-------------------------------------------------------------------------
*/
@@ -991,6 +991,7 @@ got_record:;
nextRecord = (XLogRecord *) ((char *) subrecord +
MAXALIGN(subrecord->xl_len) + SizeOfXLogSubRecord);
}
record->xl_len = len;
EndRecPtr.xlogid = readId;
EndRecPtr.xrecoff = readSeg * XLogSegSize + readOff * BLCKSZ +
SizeOfXLogPHD + SizeOfXLogSubRecord +
@@ -1412,7 +1413,9 @@ StartupXLOG()
{
char buf[8192];
sprintf(buf, "REDO @ %u/%u: ", ReadRecPtr.xlogid, ReadRecPtr.xrecoff);
sprintf(buf, "REDO @ %u/%u; LSN %u/%u: ",
ReadRecPtr.xlogid, ReadRecPtr.xrecoff,
EndRecPtr.xlogid, EndRecPtr.xrecoff);
xlog_outrec(buf, record);
strcat(buf, " - ");
RmgrTable[record->xl_rmid].rm_desc(buf,