mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +03:00
Replace implementation of pg_log as a relation accessed through the
buffer manager with 'pg_clog', a specialized access method modeled on pg_xlog. This simplifies startup (don't need to play games to open pg_log; among other things, OverrideTransactionSystem goes away), should improve performance a little, and opens the door to recycling commit log space by removing no-longer-needed segments of the commit log. Actual recycling is not there yet, but I felt I should commit this part separately since it'd still be useful if we chose not to do transaction ID wraparound.
This commit is contained in:
9
src/backend/utils/cache/relcache.c
vendored
9
src/backend/utils/cache/relcache.c
vendored
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.142 2001/08/10 18:57:37 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.143 2001/08/25 18:52:42 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -43,7 +43,6 @@
|
||||
#include "catalog/indexing.h"
|
||||
#include "catalog/pg_attrdef.h"
|
||||
#include "catalog/pg_index.h"
|
||||
#include "catalog/pg_log.h"
|
||||
#include "catalog/pg_proc.h"
|
||||
#include "catalog/pg_relcheck.h"
|
||||
#include "catalog/pg_rewrite.h"
|
||||
@@ -67,7 +66,6 @@ static FormData_pg_attribute Desc_pg_class[Natts_pg_class] = {Schema_pg_class};
|
||||
static FormData_pg_attribute Desc_pg_attribute[Natts_pg_attribute] = {Schema_pg_attribute};
|
||||
static FormData_pg_attribute Desc_pg_proc[Natts_pg_proc] = {Schema_pg_proc};
|
||||
static FormData_pg_attribute Desc_pg_type[Natts_pg_type] = {Schema_pg_type};
|
||||
static FormData_pg_attribute Desc_pg_log[Natts_pg_log] = {Schema_pg_log};
|
||||
|
||||
/*
|
||||
* Hash tables that index the relation cache
|
||||
@@ -2120,7 +2118,6 @@ RelationCacheInitialize(void)
|
||||
formrdesc(AttributeRelationName, Natts_pg_attribute, Desc_pg_attribute);
|
||||
formrdesc(ProcedureRelationName, Natts_pg_proc, Desc_pg_proc);
|
||||
formrdesc(TypeRelationName, Natts_pg_type, Desc_pg_type);
|
||||
formrdesc(LogRelationName, Natts_pg_log, Desc_pg_log);
|
||||
|
||||
/*
|
||||
* init_irels() used to be called here. It is changed to be called in
|
||||
@@ -2167,10 +2164,6 @@ RelationCacheInitializePhase2(void)
|
||||
fixrdesc(AttributeRelationName);
|
||||
fixrdesc(ProcedureRelationName);
|
||||
fixrdesc(TypeRelationName);
|
||||
|
||||
/*
|
||||
* We don't bother to update the entries for pg_log.
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.58 2001/06/12 05:55:50 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.59 2001/08/25 18:52:42 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Globals used all over the place should be declared here and not
|
||||
@@ -102,7 +102,6 @@ char *SharedSystemRelationNames[] = {
|
||||
GroupRelationName,
|
||||
GroupNameIndex,
|
||||
GroupSysidIndex,
|
||||
LogRelationName,
|
||||
ShadowRelationName,
|
||||
ShadowNameIndex,
|
||||
ShadowSysidIndex,
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.87 2001/06/16 22:58:16 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.88 2001/08/25 18:52:42 tgl Exp $
|
||||
*
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
@@ -285,26 +285,15 @@ InitPostgres(const char *dbname, const char *username)
|
||||
elog(FATAL, "InitPostgres: bad backend id %d", MyBackendId);
|
||||
|
||||
/*
|
||||
* Initialize the transaction system and the relation descriptor
|
||||
* cache. Note we have to make certain the lock manager is off while
|
||||
* we do this.
|
||||
* Initialize the transaction system override state.
|
||||
*/
|
||||
AmiTransactionOverride(IsBootstrapProcessingMode());
|
||||
LockDisable(true);
|
||||
AmiTransactionOverride(bootstrap);
|
||||
|
||||
/*
|
||||
* Part of the initialization processing done here sets a read lock on
|
||||
* pg_log. Since locking is disabled the set doesn't have intended
|
||||
* effect of locking out writers, but this is ok, since we only lock
|
||||
* it to examine AMI transaction status, and this is never written
|
||||
* after initdb is done. -mer 15 June 1992
|
||||
* Initialize the relation descriptor cache.
|
||||
* The pre-allocated reldescs are created here.
|
||||
*/
|
||||
RelationCacheInitialize(); /* pre-allocated reldescs created here */
|
||||
|
||||
InitializeTransactionSystem(); /* pg_log,etc init/crash recovery
|
||||
* here */
|
||||
|
||||
LockDisable(false);
|
||||
RelationCacheInitialize();
|
||||
|
||||
/*
|
||||
* Initialize the access methods. Does not touch files (?) - thomas
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.47 2001/05/30 20:52:34 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.48 2001/08/25 18:52:42 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -193,7 +193,7 @@ GetRawDatabaseInfo(const char *name, Oid *db_id, char *path)
|
||||
* happens right here. We cannot really determine if the
|
||||
* tuple is valid without checking transaction commit status,
|
||||
* and the only way to do that at init time is to paw over
|
||||
* pg_log by hand, too. Instead of checking, we assume that
|
||||
* pg_clog by hand, too. Instead of checking, we assume that
|
||||
* the inserting transaction committed, and that any deleting
|
||||
* transaction did also, unless shown otherwise by on-row
|
||||
* commit status bits.
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.40 2001/08/23 23:06:38 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.41 2001/08/25 18:52:42 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -611,12 +611,12 @@ HeapTupleSatisfiesVacuum(HeapTupleHeader tuple, TransactionId XmaxRecent)
|
||||
* If the inserting transaction aborted, then the tuple was never visible
|
||||
* to any other transaction, so we can delete it immediately.
|
||||
*
|
||||
* NOTE: must check TransactionIdIsInProgress (which looks in shared mem)
|
||||
* NOTE: must check TransactionIdIsInProgress (which looks in PROC array)
|
||||
* before TransactionIdDidCommit/TransactionIdDidAbort (which look in
|
||||
* pg_log). Otherwise we have a race condition where we might decide
|
||||
* pg_clog). Otherwise we have a race condition where we might decide
|
||||
* that a just-committed transaction crashed, because none of the tests
|
||||
* succeed. xact.c is careful to record commit/abort in pg_log before
|
||||
* it unsets MyProc->xid in shared memory.
|
||||
* succeed. xact.c is careful to record commit/abort in pg_clog before
|
||||
* it unsets MyProc->xid in PROC array.
|
||||
*/
|
||||
if (!(tuple->t_infomask & HEAP_XMIN_COMMITTED))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user