diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-08-25 18:52:43 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-08-25 18:52:43 +0000 |
commit | 2589735da08c4e597accb6eab5ae65b6339ee630 (patch) | |
tree | 829f7073292c6b55f86580863837441991638405 /src/backend/access/transam/xlogutils.c | |
parent | 4699d81dc99ef1687e9396b57b0ed10f42699792 (diff) | |
download | postgresql-2589735da08c4e597accb6eab5ae65b6339ee630.tar.gz postgresql-2589735da08c4e597accb6eab5ae65b6339ee630.zip |
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.
Diffstat (limited to 'src/backend/access/transam/xlogutils.c')
-rw-r--r-- | src/backend/access/transam/xlogutils.c | 38 |
1 files changed, 4 insertions, 34 deletions
diff --git a/src/backend/access/transam/xlogutils.c b/src/backend/access/transam/xlogutils.c index 9e9aa794660..4cae914cf41 100644 --- a/src/backend/access/transam/xlogutils.c +++ b/src/backend/access/transam/xlogutils.c @@ -6,24 +6,21 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Header: /cvsroot/pgsql/src/backend/access/transam/xlogutils.c,v 1.17 2001/08/23 23:06:37 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/transam/xlogutils.c,v 1.18 2001/08/25 18:52:41 tgl Exp $ * *------------------------------------------------------------------------- */ #include "postgres.h" -#include "access/xlog.h" -#include "access/transam.h" -#include "access/xact.h" -#include "storage/bufpage.h" -#include "storage/bufmgr.h" -#include "storage/smgr.h" #include "access/htup.h" #include "access/xlogutils.h" #include "catalog/pg_database.h" #include "lib/hasht.h" +#include "storage/bufpage.h" +#include "storage/smgr.h" #include "utils/relcache.h" + /* * --------------------------------------------------------------- * @@ -153,33 +150,6 @@ XLogIsValidTuple(RelFileNode hnode, ItemPointer iptr) } /* - * Open pg_log in recovery - */ -extern Relation LogRelation; /* pg_log relation */ - -void -XLogOpenLogRelation(void) -{ - Relation logRelation; - - Assert(!LogRelation); - logRelation = (Relation) malloc(sizeof(RelationData)); - memset(logRelation, 0, sizeof(RelationData)); - logRelation->rd_rel = (Form_pg_class) malloc(sizeof(FormData_pg_class)); - memset(logRelation->rd_rel, 0, sizeof(FormData_pg_class)); - - sprintf(RelationGetPhysicalRelationName(logRelation), "pg_log"); - logRelation->rd_node.tblNode = InvalidOid; - logRelation->rd_node.relNode = RelOid_pg_log; - logRelation->rd_targblock = InvalidBlockNumber; - logRelation->rd_fd = -1; - logRelation->rd_fd = smgropen(DEFAULT_SMGR, logRelation, false); - if (logRelation->rd_fd < 0) - elog(STOP, "XLogOpenLogRelation: failed to open pg_log"); - LogRelation = logRelation; -} - -/* * --------------------------------------------------------------- * * Storage related support functions |