Commit 81c8c244 authored by Vadim B. Mikheev's avatar Vadim B. Mikheev

No more #ifdef XLOG.

parent b16516b8
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.66 2000/11/21 21:15:53 petere Exp $ * $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.67 2000/11/30 08:46:20 vadim Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -23,9 +23,7 @@ ...@@ -23,9 +23,7 @@
#include "miscadmin.h" #include "miscadmin.h"
#include "utils/syscache.h" #include "utils/syscache.h"
#ifdef XLOG
#include "access/xlogutils.h" #include "access/xlogutils.h"
#endif
/* non-export function prototypes */ /* non-export function prototypes */
static InsertIndexResult gistdoinsert(Relation r, IndexTuple itup, static InsertIndexResult gistdoinsert(Relation r, IndexTuple itup,
...@@ -1348,7 +1346,6 @@ int_range_out(INTRANGE *r) ...@@ -1348,7 +1346,6 @@ int_range_out(INTRANGE *r)
#endif /* defined GISTDEBUG */ #endif /* defined GISTDEBUG */
#ifdef XLOG
void void
gist_redo(XLogRecPtr lsn, XLogRecord *record) gist_redo(XLogRecPtr lsn, XLogRecord *record)
{ {
...@@ -1365,4 +1362,3 @@ void ...@@ -1365,4 +1362,3 @@ void
gist_desc(char *buf, uint8 xl_info, char* rec) gist_desc(char *buf, uint8 xl_info, char* rec)
{ {
} }
#endif
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.45 2000/11/21 21:15:54 petere Exp $ * $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.46 2000/11/30 08:46:20 vadim Exp $
* *
* NOTES * NOTES
* This file contains only the public interface routines. * This file contains only the public interface routines.
...@@ -27,9 +27,7 @@ ...@@ -27,9 +27,7 @@
bool BuildingHash = false; bool BuildingHash = false;
#ifdef XLOG
#include "access/xlogutils.h" #include "access/xlogutils.h"
#endif
/* /*
...@@ -482,7 +480,6 @@ hashdelete(PG_FUNCTION_ARGS) ...@@ -482,7 +480,6 @@ hashdelete(PG_FUNCTION_ARGS)
PG_RETURN_VOID(); PG_RETURN_VOID();
} }
#ifdef XLOG
void void
hash_redo(XLogRecPtr lsn, XLogRecord *record) hash_redo(XLogRecPtr lsn, XLogRecord *record)
{ {
...@@ -499,4 +496,3 @@ void ...@@ -499,4 +496,3 @@ void
hash_desc(char *buf, uint8 xl_info, char* rec) hash_desc(char *buf, uint8 xl_info, char* rec)
{ {
} }
#endif
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.96 2000/11/21 21:15:54 petere Exp $ * $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.97 2000/11/30 08:46:20 vadim Exp $
* *
* *
* INTERFACE ROUTINES * INTERFACE ROUTINES
...@@ -86,7 +86,6 @@ ...@@ -86,7 +86,6 @@
#include "utils/inval.h" #include "utils/inval.h"
#include "utils/relcache.h" #include "utils/relcache.h"
#ifdef XLOG
#include "access/xlogutils.h" #include "access/xlogutils.h"
XLogRecPtr log_heap_move(Relation reln, ItemPointerData from, HeapTuple newtup); XLogRecPtr log_heap_move(Relation reln, ItemPointerData from, HeapTuple newtup);
...@@ -99,8 +98,6 @@ static XLogRecPtr log_heap_update(Relation reln, ItemPointerData from, ...@@ -99,8 +98,6 @@ static XLogRecPtr log_heap_update(Relation reln, ItemPointerData from,
static void HeapPageCleanup(Buffer buffer); static void HeapPageCleanup(Buffer buffer);
#endif
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
* heap support routines * heap support routines
...@@ -1370,7 +1367,6 @@ heap_insert(Relation relation, HeapTuple tup) ...@@ -1370,7 +1367,6 @@ heap_insert(Relation relation, HeapTuple tup)
/* NO ELOG(ERROR) from here till changes are logged */ /* NO ELOG(ERROR) from here till changes are logged */
RelationPutHeapTuple(relation, buffer, tup); RelationPutHeapTuple(relation, buffer, tup);
#ifdef XLOG
/* XLOG stuff */ /* XLOG stuff */
{ {
xl_heap_insert xlrec; xl_heap_insert xlrec;
...@@ -1392,7 +1388,6 @@ heap_insert(Relation relation, HeapTuple tup) ...@@ -1392,7 +1388,6 @@ heap_insert(Relation relation, HeapTuple tup)
PageSetLSN(BufferGetPage(buffer), recptr); PageSetLSN(BufferGetPage(buffer), recptr);
PageSetSUI(BufferGetPage(buffer), ThisStartUpID); PageSetSUI(BufferGetPage(buffer), ThisStartUpID);
} }
#endif
LockBuffer(buffer, BUFFER_LOCK_UNLOCK); LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
WriteBuffer(buffer); WriteBuffer(buffer);
...@@ -1485,7 +1480,6 @@ l1: ...@@ -1485,7 +1480,6 @@ l1:
return result; return result;
} }
#ifdef XLOG
/* XLOG stuff */ /* XLOG stuff */
{ {
xl_heap_delete xlrec; xl_heap_delete xlrec;
...@@ -1500,7 +1494,6 @@ l1: ...@@ -1500,7 +1494,6 @@ l1:
PageSetLSN(dp, recptr); PageSetLSN(dp, recptr);
PageSetSUI(dp, ThisStartUpID); PageSetSUI(dp, ThisStartUpID);
} }
#endif
/* store transaction information of xact deleting the tuple */ /* store transaction information of xact deleting the tuple */
TransactionIdStore(GetCurrentTransactionId(), &(tp.t_data->t_xmax)); TransactionIdStore(GetCurrentTransactionId(), &(tp.t_data->t_xmax));
...@@ -1638,7 +1631,6 @@ l2: ...@@ -1638,7 +1631,6 @@ l2:
newbuf = buffer; newbuf = buffer;
else else
{ {
#ifdef XLOG
/* /*
* We have to unlock old tuple buffer before extending table * We have to unlock old tuple buffer before extending table
* file but have to keep lock on the old tuple. To avoid second * file but have to keep lock on the old tuple. To avoid second
...@@ -1650,7 +1642,7 @@ l2: ...@@ -1650,7 +1642,7 @@ l2:
_locked_tuple_.node = relation->rd_node; _locked_tuple_.node = relation->rd_node;
_locked_tuple_.tid = *otid; _locked_tuple_.tid = *otid;
XactPushRollback(_heap_unlock_tuple, (void*) &_locked_tuple_); XactPushRollback(_heap_unlock_tuple, (void*) &_locked_tuple_);
#endif
TransactionIdStore(GetCurrentTransactionId(), &(oldtup.t_data->t_xmax)); TransactionIdStore(GetCurrentTransactionId(), &(oldtup.t_data->t_xmax));
oldtup.t_data->t_cmax = GetCurrentCommandId(); oldtup.t_data->t_cmax = GetCurrentCommandId();
oldtup.t_data->t_infomask &= ~(HEAP_XMAX_COMMITTED | oldtup.t_data->t_infomask &= ~(HEAP_XMAX_COMMITTED |
...@@ -1677,15 +1669,12 @@ l2: ...@@ -1677,15 +1669,12 @@ l2:
else else
{ {
oldtup.t_data->t_infomask &= ~HEAP_XMAX_UNLOGGED; oldtup.t_data->t_infomask &= ~HEAP_XMAX_UNLOGGED;
#ifdef XLOG
XactPopRollback(); XactPopRollback();
#endif
} }
/* record address of new tuple in t_ctid of old one */ /* record address of new tuple in t_ctid of old one */
oldtup.t_data->t_ctid = newtup->t_self; oldtup.t_data->t_ctid = newtup->t_self;
#ifdef XLOG
/* XLOG stuff */ /* XLOG stuff */
{ {
XLogRecPtr recptr = log_heap_update(relation, XLogRecPtr recptr = log_heap_update(relation,
...@@ -1699,7 +1688,6 @@ l2: ...@@ -1699,7 +1688,6 @@ l2:
PageSetLSN(BufferGetPage(buffer), recptr); PageSetLSN(BufferGetPage(buffer), recptr);
PageSetSUI(BufferGetPage(buffer), ThisStartUpID); PageSetSUI(BufferGetPage(buffer), ThisStartUpID);
} }
#endif
if (newbuf != buffer) if (newbuf != buffer)
{ {
...@@ -1791,13 +1779,11 @@ l3: ...@@ -1791,13 +1779,11 @@ l3:
return result; return result;
} }
#ifdef XLOG
/* /*
* XLOG stuff: no logging is required as long as we have no * XLOG stuff: no logging is required as long as we have no
* savepoints. For savepoints private log could be used... * savepoints. For savepoints private log could be used...
*/ */
((PageHeader) BufferGetPage(*buffer))->pd_sui = ThisStartUpID; ((PageHeader) BufferGetPage(*buffer))->pd_sui = ThisStartUpID;
#endif
/* store transaction information of xact marking the tuple */ /* store transaction information of xact marking the tuple */
TransactionIdStore(GetCurrentTransactionId(), &(tuple->t_data->t_xmax)); TransactionIdStore(GetCurrentTransactionId(), &(tuple->t_data->t_xmax));
...@@ -1984,8 +1970,6 @@ heap_restrpos(HeapScanDesc scan) ...@@ -1984,8 +1970,6 @@ heap_restrpos(HeapScanDesc scan)
} }
} }
#ifdef XLOG
static XLogRecPtr static XLogRecPtr
log_heap_update(Relation reln, ItemPointerData from, log_heap_update(Relation reln, ItemPointerData from,
HeapTuple newtup, bool move) HeapTuple newtup, bool move)
...@@ -2634,5 +2618,3 @@ heap_desc(char *buf, uint8 xl_info, char* rec) ...@@ -2634,5 +2618,3 @@ heap_desc(char *buf, uint8 xl_info, char* rec)
else else
strcat(buf, "UNKNOWN"); strcat(buf, "UNKNOWN");
} }
#endif /* XLOG */
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.68 2000/11/16 05:50:58 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.69 2000/11/30 08:46:21 vadim Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -61,9 +61,7 @@ static void _bt_pgaddtup(Relation rel, Page page, ...@@ -61,9 +61,7 @@ static void _bt_pgaddtup(Relation rel, Page page,
static bool _bt_isequal(TupleDesc itupdesc, Page page, OffsetNumber offnum, static bool _bt_isequal(TupleDesc itupdesc, Page page, OffsetNumber offnum,
int keysz, ScanKey scankey); int keysz, ScanKey scankey);
#ifdef XLOG
static Relation _xlheapRel; /* temporary hack */ static Relation _xlheapRel; /* temporary hack */
#endif
/* /*
* _bt_doinsert() -- Handle insertion of a single btitem in the tree. * _bt_doinsert() -- Handle insertion of a single btitem in the tree.
...@@ -123,9 +121,7 @@ top: ...@@ -123,9 +121,7 @@ top:
} }
} }
#ifdef XLOG
_xlheapRel = heapRel; /* temporary hack */ _xlheapRel = heapRel; /* temporary hack */
#endif
/* do the insertion */ /* do the insertion */
res = _bt_insertonpg(rel, buf, stack, natts, itup_scankey, btitem, 0); res = _bt_insertonpg(rel, buf, stack, natts, itup_scankey, btitem, 0);
...@@ -522,7 +518,6 @@ _bt_insertonpg(Relation rel, ...@@ -522,7 +518,6 @@ _bt_insertonpg(Relation rel,
} }
else else
{ {
#ifdef XLOG
/* XLOG stuff */ /* XLOG stuff */
{ {
char xlbuf[sizeof(xl_btree_insert) + char xlbuf[sizeof(xl_btree_insert) +
...@@ -562,7 +557,7 @@ _bt_insertonpg(Relation rel, ...@@ -562,7 +557,7 @@ _bt_insertonpg(Relation rel,
PageSetLSN(page, recptr); PageSetLSN(page, recptr);
PageSetSUI(page, ThisStartUpID); PageSetSUI(page, ThisStartUpID);
} }
#endif
_bt_pgaddtup(rel, page, itemsz, btitem, newitemoff, "page"); _bt_pgaddtup(rel, page, itemsz, btitem, newitemoff, "page");
itup_off = newitemoff; itup_off = newitemoff;
itup_blkno = BufferGetBlockNumber(buf); itup_blkno = BufferGetBlockNumber(buf);
...@@ -612,10 +607,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright, ...@@ -612,10 +607,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
rightoff; rightoff;
OffsetNumber maxoff; OffsetNumber maxoff;
OffsetNumber i; OffsetNumber i;
#ifdef XLOG
BTItem lhikey; BTItem lhikey;
#endif
rbuf = _bt_getbuf(rel, P_NEW, BT_WRITE); rbuf = _bt_getbuf(rel, P_NEW, BT_WRITE);
origpage = BufferGetPage(buf); origpage = BufferGetPage(buf);
...@@ -685,9 +677,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright, ...@@ -685,9 +677,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
itemsz = ItemIdGetLength(itemid); itemsz = ItemIdGetLength(itemid);
item = (BTItem) PageGetItem(origpage, itemid); item = (BTItem) PageGetItem(origpage, itemid);
} }
#ifdef XLOG
lhikey = item; lhikey = item;
#endif
if (PageAddItem(leftpage, (Item) item, itemsz, leftoff, if (PageAddItem(leftpage, (Item) item, itemsz, leftoff,
LP_USED) == InvalidOffsetNumber) LP_USED) == InvalidOffsetNumber)
elog(STOP, "btree: failed to add hikey to the left sibling"); elog(STOP, "btree: failed to add hikey to the left sibling");
...@@ -775,7 +765,6 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright, ...@@ -775,7 +765,6 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
spage = BufferGetPage(sbuf); spage = BufferGetPage(sbuf);
} }
#ifdef XLOG
/* /*
* Right sibling is locked, new siblings are prepared, but original * Right sibling is locked, new siblings are prepared, but original
* page is not updated yet. Log changes before continuing. * page is not updated yet. Log changes before continuing.
...@@ -860,7 +849,6 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright, ...@@ -860,7 +849,6 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
PageSetSUI(spage, ThisStartUpID); PageSetSUI(spage, ThisStartUpID);
} }
} }
#endif
/* /*
* By here, the original data page has been split into two new halves, * By here, the original data page has been split into two new halves,
...@@ -1165,19 +1153,13 @@ _bt_newroot(Relation rel, Buffer lbuf, Buffer rbuf) ...@@ -1165,19 +1153,13 @@ _bt_newroot(Relation rel, Buffer lbuf, Buffer rbuf)
BTItem item; BTItem item;
Size itemsz; Size itemsz;
BTItem new_item; BTItem new_item;
#ifdef XLOG
Buffer metabuf; Buffer metabuf;
#endif
/* get a new root page */ /* get a new root page */
rootbuf = _bt_getbuf(rel, P_NEW, BT_WRITE); rootbuf = _bt_getbuf(rel, P_NEW, BT_WRITE);
rootpage = BufferGetPage(rootbuf); rootpage = BufferGetPage(rootbuf);
rootblknum = BufferGetBlockNumber(rootbuf); rootblknum = BufferGetBlockNumber(rootbuf);
#ifdef XLOG
metabuf = _bt_getbuf(rel, BTREE_METAPAGE,BT_WRITE); metabuf = _bt_getbuf(rel, BTREE_METAPAGE,BT_WRITE);
#endif
/* NO ELOG(ERROR) from here till newroot op is logged */ /* NO ELOG(ERROR) from here till newroot op is logged */
...@@ -1237,7 +1219,6 @@ _bt_newroot(Relation rel, Buffer lbuf, Buffer rbuf) ...@@ -1237,7 +1219,6 @@ _bt_newroot(Relation rel, Buffer lbuf, Buffer rbuf)
elog(STOP, "btree: failed to add rightkey to new root page"); elog(STOP, "btree: failed to add rightkey to new root page");
pfree(new_item); pfree(new_item);
#ifdef XLOG
/* XLOG stuff */ /* XLOG stuff */
{ {
xl_btree_newroot xlrec; xl_btree_newroot xlrec;
...@@ -1267,16 +1248,10 @@ _bt_newroot(Relation rel, Buffer lbuf, Buffer rbuf) ...@@ -1267,16 +1248,10 @@ _bt_newroot(Relation rel, Buffer lbuf, Buffer rbuf)
_bt_wrtbuf(rel, metabuf); _bt_wrtbuf(rel, metabuf);
} }
#endif
/* write and let go of the new root buffer */ /* write and let go of the new root buffer */
_bt_wrtbuf(rel, rootbuf); _bt_wrtbuf(rel, rootbuf);
#ifndef XLOG
/* update metadata page with new root block number */
_bt_metaproot(rel, rootblknum, 0);
#endif
/* update and release new sibling, and finally the old root */ /* update and release new sibling, and finally the old root */
_bt_wrtbuf(rel, rbuf); _bt_wrtbuf(rel, rbuf);
_bt_wrtbuf(rel, lbuf); _bt_wrtbuf(rel, lbuf);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtpage.c,v 1.41 2000/11/30 01:39:06 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtpage.c,v 1.42 2000/11/30 08:46:21 vadim Exp $
* *
* NOTES * NOTES
* Postgres btree pages look like ordinary relation pages. The opaque * Postgres btree pages look like ordinary relation pages. The opaque
...@@ -170,7 +170,6 @@ _bt_getroot(Relation rel, int access) ...@@ -170,7 +170,6 @@ _bt_getroot(Relation rel, int access)
rootopaque = (BTPageOpaque) PageGetSpecialPointer(rootpage); rootopaque = (BTPageOpaque) PageGetSpecialPointer(rootpage);
rootopaque->btpo_flags |= (BTP_LEAF | BTP_ROOT); rootopaque->btpo_flags |= (BTP_LEAF | BTP_ROOT);
#ifdef XLOG
/* XLOG stuff */ /* XLOG stuff */
{ {
xl_btree_newroot xlrec; xl_btree_newroot xlrec;
...@@ -187,7 +186,6 @@ _bt_getroot(Relation rel, int access) ...@@ -187,7 +186,6 @@ _bt_getroot(Relation rel, int access)
PageSetLSN(metapg, recptr); PageSetLSN(metapg, recptr);
PageSetSUI(metapg, ThisStartUpID); PageSetSUI(metapg, ThisStartUpID);
} }
#endif
metad->btm_root = rootblkno; metad->btm_root = rootblkno;
metad->btm_level = 1; metad->btm_level = 1;
...@@ -403,7 +401,6 @@ _bt_pagedel(Relation rel, ItemPointer tid) ...@@ -403,7 +401,6 @@ _bt_pagedel(Relation rel, ItemPointer tid)
buf = _bt_getbuf(rel, blkno, BT_WRITE); buf = _bt_getbuf(rel, blkno, BT_WRITE);
page = BufferGetPage(buf); page = BufferGetPage(buf);
#ifdef XLOG
/* XLOG stuff */ /* XLOG stuff */
{ {
xl_btree_delete xlrec; xl_btree_delete xlrec;
...@@ -417,7 +414,6 @@ _bt_pagedel(Relation rel, ItemPointer tid) ...@@ -417,7 +414,6 @@ _bt_pagedel(Relation rel, ItemPointer tid)
PageSetLSN(page, recptr); PageSetLSN(page, recptr);
PageSetSUI(page, ThisStartUpID); PageSetSUI(page, ThisStartUpID);
} }
#endif
PageIndexTupleDelete(page, offno); PageIndexTupleDelete(page, offno);
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.71 2000/11/21 21:15:55 petere Exp $ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.72 2000/11/30 08:46:21 vadim Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -32,11 +32,8 @@ bool BuildingBtree = false; /* see comment in btbuild() */ ...@@ -32,11 +32,8 @@ bool BuildingBtree = false; /* see comment in btbuild() */
bool FastBuild = true; /* use sort/build instead of insertion bool FastBuild = true; /* use sort/build instead of insertion
* build */ * build */
#ifdef XLOG
#include "access/xlogutils.h" #include "access/xlogutils.h"
#endif
static void _bt_restscan(IndexScanDesc scan); static void _bt_restscan(IndexScanDesc scan);
/* /*
...@@ -733,8 +730,6 @@ _bt_restscan(IndexScanDesc scan) ...@@ -733,8 +730,6 @@ _bt_restscan(IndexScanDesc scan)
} }
} }
#ifdef XLOG
static bool static bool
_bt_cleanup_page(Page page, RelFileNode hnode) _bt_cleanup_page(Page page, RelFileNode hnode)
{ {
...@@ -1529,5 +1524,3 @@ btree_desc(char *buf, uint8 xl_info, char* rec) ...@@ -1529,5 +1524,3 @@ btree_desc(char *buf, uint8 xl_info, char* rec)
else else
strcat(buf, "UNKNOWN"); strcat(buf, "UNKNOWN");
} }
#endif
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.56 2000/11/21 21:15:55 petere Exp $ * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.57 2000/11/30 08:46:21 vadim Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -22,9 +22,7 @@ ...@@ -22,9 +22,7 @@
#include "executor/executor.h" #include "executor/executor.h"
#include "miscadmin.h" #include "miscadmin.h"
#ifdef XLOG
#include "access/xlogutils.h" #include "access/xlogutils.h"
#endif
typedef struct SPLITVEC typedef struct SPLITVEC
{ {
...@@ -1069,7 +1067,6 @@ _rtdump(Relation r) ...@@ -1069,7 +1067,6 @@ _rtdump(Relation r)
#endif /* defined RTDEBUG */ #endif /* defined RTDEBUG */
#ifdef XLOG
void void
rtree_redo(XLogRecPtr lsn, XLogRecord *record) rtree_redo(XLogRecPtr lsn, XLogRecord *record)
{ {
...@@ -1086,4 +1083,3 @@ void ...@@ -1086,4 +1083,3 @@ void
rtree_desc(char *buf, uint8 xl_info, char* rec) rtree_desc(char *buf, uint8 xl_info, char* rec)
{ {
} }
#endif
...@@ -27,4 +27,3 @@ RmgrData RmgrTable[] = { ...@@ -27,4 +27,3 @@ RmgrData RmgrTable[] = {
{"Gist", gist_redo, gist_undo, gist_desc}, {"Gist", gist_redo, gist_undo, gist_desc},
{"Sequence", seq_redo, seq_undo, seq_desc} {"Sequence", seq_redo, seq_undo, seq_desc}
}; };
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/transam.c,v 1.37 2000/11/21 21:15:57 petere Exp $ * $Header: /cvsroot/pgsql/src/backend/access/transam/transam.c,v 1.38 2000/11/30 08:46:22 vadim Exp $
* *
* NOTES * NOTES
* This file contains the high level access-method interface to the * This file contains the high level access-method interface to the
...@@ -424,23 +424,12 @@ InitializeTransactionLog(void) ...@@ -424,23 +424,12 @@ InitializeTransactionLog(void)
SpinAcquire(OidGenLockId); SpinAcquire(OidGenLockId);
if (!TransactionIdDidCommit(AmiTransactionId)) if (!TransactionIdDidCommit(AmiTransactionId))
{ {
/* ----------------
* SOMEDAY initialize the information stored in
* the headers of the log/variable relations.
* ----------------
*/
TransactionLogUpdate(AmiTransactionId, XID_COMMIT); TransactionLogUpdate(AmiTransactionId, XID_COMMIT);
TransactionIdStore(AmiTransactionId, &cachedTestXid); TransactionIdStore(AmiTransactionId, &cachedTestXid);
cachedTestXidStatus = XID_COMMIT; cachedTestXidStatus = XID_COMMIT;
#ifdef XLOG
Assert(!IsUnderPostmaster && Assert(!IsUnderPostmaster &&
ShmemVariableCache->nextXid <= FirstTransactionId); ShmemVariableCache->nextXid <= FirstTransactionId);
ShmemVariableCache->nextXid = FirstTransactionId; ShmemVariableCache->nextXid = FirstTransactionId;
#else
VariableRelationPutNextXid(FirstTransactionId);
#endif
} }
else if (RecoveryCheckingEnabled()) else if (RecoveryCheckingEnabled())
{ {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/transsup.c,v 1.26 2000/10/28 16:20:53 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/transsup.c,v 1.27 2000/11/30 08:46:22 vadim Exp $
* *
* NOTES * NOTES
* This file contains support functions for the high * This file contains support functions for the high
...@@ -186,9 +186,7 @@ TransBlockGetXidStatus(Block tblock, ...@@ -186,9 +186,7 @@ TransBlockGetXidStatus(Block tblock,
bits8 bit2; bits8 bit2;
BitIndex offset; BitIndex offset;
#ifdef XLOG
tblock = (Block) ((char*) tblock + sizeof(XLogRecPtr)); tblock = (Block) ((char*) tblock + sizeof(XLogRecPtr));
#endif
/* ---------------- /* ----------------
* calculate the index into the transaction data where * calculate the index into the transaction data where
...@@ -231,9 +229,7 @@ TransBlockSetXidStatus(Block tblock, ...@@ -231,9 +229,7 @@ TransBlockSetXidStatus(Block tblock,
Index index; Index index;
BitIndex offset; BitIndex offset;
#ifdef XLOG
tblock = (Block) ((char*) tblock + sizeof(XLogRecPtr)); tblock = (Block) ((char*) tblock + sizeof(XLogRecPtr));
#endif
/* ---------------- /* ----------------
* calculate the index into the transaction data where * calculate the index into the transaction data where
......
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.85 2000/11/30 01:47:31 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.86 2000/11/30 08:46:22 vadim Exp $
* *
* NOTES * NOTES
* Transaction aborts can now occur two ways: * Transaction aborts can now occur two ways:
...@@ -219,7 +219,6 @@ TransactionState CurrentTransactionState = &CurrentTransactionStateData; ...@@ -219,7 +219,6 @@ TransactionState CurrentTransactionState = &CurrentTransactionStateData;
int DefaultXactIsoLevel = XACT_READ_COMMITTED; int DefaultXactIsoLevel = XACT_READ_COMMITTED;
int XactIsoLevel; int XactIsoLevel;
#ifdef XLOG
#include "access/xlogutils.h" #include "access/xlogutils.h"
int CommitDelay = 5; /* 1/200000 sec */ int CommitDelay = 5; /* 1/200000 sec */
...@@ -227,8 +226,6 @@ int CommitDelay = 5; /* 1/200000 sec */ ...@@ -227,8 +226,6 @@ int CommitDelay = 5; /* 1/200000 sec */
static void (*_RollbackFunc)(void*) = NULL; static void (*_RollbackFunc)(void*) = NULL;
static void *_RollbackData = NULL; static void *_RollbackData = NULL;
#endif
/* ---------------- /* ----------------
* info returned when the system is disabled * info returned when the system is disabled
* *
...@@ -662,19 +659,10 @@ RecordTransactionCommit() ...@@ -662,19 +659,10 @@ RecordTransactionCommit()
TransactionId xid; TransactionId xid;
int leak; int leak;
/* ----------------
* get the current transaction id
* ----------------
*/
xid = GetCurrentTransactionId(); xid = GetCurrentTransactionId();
/*
* flush the buffer manager pages. Note: if we have stable main
* memory, dirty shared buffers are not flushed plai 8/7/90
*/
leak = BufferPoolCheckLeak(); leak = BufferPoolCheckLeak();
#ifdef XLOG
if (MyLastRecPtr.xrecoff != 0) if (MyLastRecPtr.xrecoff != 0)
{ {
xl_xact_commit xlrec; xl_xact_commit xlrec;
...@@ -685,7 +673,7 @@ RecordTransactionCommit() ...@@ -685,7 +673,7 @@ RecordTransactionCommit()
xlrec.xtime = time(NULL); xlrec.xtime = time(NULL);
/* /*
* MUST SAVE ARRAY OF RELFILENODE-s TO DROP * SHOULD SAVE ARRAY OF RELFILENODE-s TO DROP
*/ */
recptr = XLogInsert(RM_XACT_ID, XLOG_XACT_COMMIT, recptr = XLogInsert(RM_XACT_ID, XLOG_XACT_COMMIT,
(char*) &xlrec, SizeOfXactCommit, NULL, 0); (char*) &xlrec, SizeOfXactCommit, NULL, 0);
...@@ -704,30 +692,6 @@ RecordTransactionCommit() ...@@ -704,30 +692,6 @@ RecordTransactionCommit()
MyProc->logRec.xrecoff = 0; MyProc->logRec.xrecoff = 0;
} }
#else
/*
* If no one shared buffer was changed by this transaction then we
* don't flush shared buffers and don't record commit status.
*/
if (SharedBufferChanged)
{
FlushBufferPool();
if (leak)
ResetBufferPool(true);
/*
* have the transaction access methods record the status of this
* transaction id in the pg_log relation.
*/
TransactionIdCommit(xid);
/*
* Now write the log info to the disk too.
*/
leak = BufferPoolCheckLeak();
FlushBufferPool();
}
#endif
if (leak) if (leak)
ResetBufferPool(true); ResetBufferPool(true);
...@@ -815,23 +779,8 @@ AtCommit_Memory(void) ...@@ -815,23 +779,8 @@ AtCommit_Memory(void)
static void static void
RecordTransactionAbort(void) RecordTransactionAbort(void)
{ {
TransactionId xid; TransactionId xid = GetCurrentTransactionId();
/* ----------------
* get the current transaction id
* ----------------
*/
xid = GetCurrentTransactionId();
/*
* Have the transaction access methods record the status of this
* transaction id in the pg_log relation. We skip it if no one shared
* buffer was changed by this transaction.
*/
if (SharedBufferChanged && !TransactionIdDidCommit(xid))
TransactionIdAbort(xid);
#ifdef XLOG
if (MyLastRecPtr.xrecoff != 0) if (MyLastRecPtr.xrecoff != 0)
{ {
xl_xact_abort xlrec; xl_xact_abort xlrec;
...@@ -841,9 +790,9 @@ RecordTransactionAbort(void) ...@@ -841,9 +790,9 @@ RecordTransactionAbort(void)
recptr = XLogInsert(RM_XACT_ID, XLOG_XACT_ABORT, recptr = XLogInsert(RM_XACT_ID, XLOG_XACT_ABORT,
(char*) &xlrec, SizeOfXactAbort, NULL, 0); (char*) &xlrec, SizeOfXactAbort, NULL, 0);
TransactionIdAbort(xid);
MyProc->logRec.xrecoff = 0; MyProc->logRec.xrecoff = 0;
} }
#endif
/* /*
* Tell bufmgr and smgr to release resources. * Tell bufmgr and smgr to release resources.
...@@ -1748,8 +1697,6 @@ IsTransactionBlock(void) ...@@ -1748,8 +1697,6 @@ IsTransactionBlock(void)
return false; return false;
} }
#ifdef XLOG
void void
xact_redo(XLogRecPtr lsn, XLogRecord *record) xact_redo(XLogRecPtr lsn, XLogRecord *record)
{ {
...@@ -1760,7 +1707,7 @@ xact_redo(XLogRecPtr lsn, XLogRecord *record) ...@@ -1760,7 +1707,7 @@ xact_redo(XLogRecPtr lsn, XLogRecord *record)
xl_xact_commit *xlrec = (xl_xact_commit*) XLogRecGetData(record); xl_xact_commit *xlrec = (xl_xact_commit*) XLogRecGetData(record);
TransactionIdCommit(record->xl_xid); TransactionIdCommit(record->xl_xid);
/* MUST REMOVE FILES OF ALL DROPPED RELATIONS */ /* SHOULD REMOVE FILES OF ALL DROPPED RELATIONS */
} }
else if (info == XLOG_XACT_ABORT) else if (info == XLOG_XACT_ABORT)
{ {
...@@ -1825,5 +1772,3 @@ XactPopRollback(void) ...@@ -1825,5 +1772,3 @@ XactPopRollback(void)
{ {
_RollbackFunc = NULL; _RollbackFunc = NULL;
} }
#endif
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.37 2000/11/30 01:47:31 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.38 2000/11/30 08:46:22 vadim Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1443,12 +1443,10 @@ void ...@@ -1443,12 +1443,10 @@ void
BootStrapXLOG() BootStrapXLOG()
{ {
CheckPoint checkPoint; CheckPoint checkPoint;
#ifdef XLOG
char buffer[BLCKSZ]; char buffer[BLCKSZ];
bool usexistent = false; bool usexistent = false;
XLogPageHeader page = (XLogPageHeader) buffer; XLogPageHeader page = (XLogPageHeader) buffer;
XLogRecord *record; XLogRecord *record;
#endif
checkPoint.redo.xlogid = 0; checkPoint.redo.xlogid = 0;
checkPoint.redo.xrecoff = SizeOfXLogPHD; checkPoint.redo.xrecoff = SizeOfXLogPHD;
...@@ -1462,8 +1460,6 @@ BootStrapXLOG() ...@@ -1462,8 +1460,6 @@ BootStrapXLOG()
ShmemVariableCache->nextOid = checkPoint.nextOid; ShmemVariableCache->nextOid = checkPoint.nextOid;
ShmemVariableCache->oidCount = 0; ShmemVariableCache->oidCount = 0;
#ifdef XLOG
memset(buffer, 0, BLCKSZ); memset(buffer, 0, BLCKSZ);
page->xlp_magic = XLOG_PAGE_MAGIC; page->xlp_magic = XLOG_PAGE_MAGIC;
page->xlp_info = 0; page->xlp_info = 0;
...@@ -1488,8 +1484,6 @@ BootStrapXLOG() ...@@ -1488,8 +1484,6 @@ BootStrapXLOG()
close(logFile); close(logFile);
logFile = -1; logFile = -1;
#endif
memset(ControlFile, 0, sizeof(ControlFileData)); memset(ControlFile, 0, sizeof(ControlFileData));
ControlFile->logId = 0; ControlFile->logId = 0;
ControlFile->logSeg = 1; ControlFile->logSeg = 1;
...@@ -1513,14 +1507,12 @@ str_time(time_t tnow) ...@@ -1513,14 +1507,12 @@ str_time(time_t tnow)
return buf; return buf;
} }
/* /*
* This func must be called ONCE on system startup * This func must be called ONCE on system startup
*/ */
void void
StartupXLOG() StartupXLOG()
{ {
#ifdef XLOG
XLogCtlInsert *Insert; XLogCtlInsert *Insert;
CheckPoint checkPoint; CheckPoint checkPoint;
XLogRecPtr RecPtr, XLogRecPtr RecPtr,
...@@ -1529,8 +1521,6 @@ StartupXLOG() ...@@ -1529,8 +1521,6 @@ StartupXLOG()
char buffer[MAXLOGRECSZ + SizeOfXLogRecord]; char buffer[MAXLOGRECSZ + SizeOfXLogRecord];
bool sie_saved = false; bool sie_saved = false;
#endif
elog(LOG, "starting up"); elog(LOG, "starting up");
XLogCtl->xlblocks = (XLogRecPtr *) (((char *) XLogCtl) + sizeof(XLogCtlData)); XLogCtl->xlblocks = (XLogRecPtr *) (((char *) XLogCtl) + sizeof(XLogCtlData));
...@@ -1580,8 +1570,6 @@ StartupXLOG() ...@@ -1580,8 +1570,6 @@ StartupXLOG()
elog(LOG, "database system was interrupted at %s", elog(LOG, "database system was interrupted at %s",
str_time(ControlFile->time)); str_time(ControlFile->time));
#ifdef XLOG
LastRec = RecPtr = ControlFile->checkPoint; LastRec = RecPtr = ControlFile->checkPoint;
if (!XRecOffIsValid(RecPtr.xrecoff)) if (!XRecOffIsValid(RecPtr.xrecoff))
elog(STOP, "Invalid checkPoint in control file"); elog(STOP, "Invalid checkPoint in control file");
...@@ -1602,12 +1590,7 @@ StartupXLOG() ...@@ -1602,12 +1590,7 @@ StartupXLOG()
checkPoint.nextXid, checkPoint.nextOid); checkPoint.nextXid, checkPoint.nextOid);
if (checkPoint.nextXid < FirstTransactionId || if (checkPoint.nextXid < FirstTransactionId ||
checkPoint.nextOid < BootstrapObjectIdData) checkPoint.nextOid < BootstrapObjectIdData)
#ifdef XLOG_2
elog(STOP, "Invalid NextTransactionId/NextOid"); elog(STOP, "Invalid NextTransactionId/NextOid");
#else
elog(LOG, "Invalid NextTransactionId/NextOid");
#endif
ShmemVariableCache->nextXid = checkPoint.nextXid; ShmemVariableCache->nextXid = checkPoint.nextXid;
ShmemVariableCache->nextOid = checkPoint.nextOid; ShmemVariableCache->nextOid = checkPoint.nextOid;
...@@ -1751,8 +1734,6 @@ StartupXLOG() ...@@ -1751,8 +1734,6 @@ StartupXLOG()
} }
InRecovery = false; InRecovery = false;
#endif /* XLOG */
ControlFile->state = DB_IN_PRODUCTION; ControlFile->state = DB_IN_PRODUCTION;
ControlFile->time = time(NULL); ControlFile->time = time(NULL);
UpdateControlFile(); UpdateControlFile();
...@@ -1783,9 +1764,7 @@ ShutdownXLOG() ...@@ -1783,9 +1764,7 @@ ShutdownXLOG()
{ {
elog(LOG, "shutting down"); elog(LOG, "shutting down");
#ifdef XLOG
CreateDummyCaches(); CreateDummyCaches();
#endif
CreateCheckPoint(true); CreateCheckPoint(true);
elog(LOG, "database system is shut down"); elog(LOG, "database system is shut down");
...@@ -1796,7 +1775,6 @@ extern XLogRecPtr GetUndoRecPtr(void); ...@@ -1796,7 +1775,6 @@ extern XLogRecPtr GetUndoRecPtr(void);
void void
CreateCheckPoint(bool shutdown) CreateCheckPoint(bool shutdown)
{ {
#ifdef XLOG
CheckPoint checkPoint; CheckPoint checkPoint;
XLogRecPtr recptr; XLogRecPtr recptr;
XLogCtlInsert *Insert = &XLogCtl->Insert; XLogCtlInsert *Insert = &XLogCtl->Insert;
...@@ -1880,12 +1858,9 @@ CreateCheckPoint(bool shutdown) ...@@ -1880,12 +1858,9 @@ CreateCheckPoint(bool shutdown)
XLogFlush(recptr); XLogFlush(recptr);
#endif /* XLOG */
SpinAcquire(ControlFileLockId); SpinAcquire(ControlFileLockId);
if (shutdown) if (shutdown)
ControlFile->state = DB_SHUTDOWNED; ControlFile->state = DB_SHUTDOWNED;
#ifdef XLOG
else /* create new log file */ else /* create new log file */
{ {
if (recptr.xrecoff % XLogSegSize >= if (recptr.xrecoff % XLogSegSize >=
...@@ -1914,16 +1889,10 @@ CreateCheckPoint(bool shutdown) ...@@ -1914,16 +1889,10 @@ CreateCheckPoint(bool shutdown)
_logSeg = ControlFile->logSeg - 1; _logSeg = ControlFile->logSeg - 1;
strcpy(archdir, ControlFile->archdir); strcpy(archdir, ControlFile->archdir);
#else
ControlFile->checkPoint.xlogid = 0;
ControlFile->checkPoint.xrecoff = SizeOfXLogPHD;
#endif
ControlFile->time = time(NULL); ControlFile->time = time(NULL);
UpdateControlFile(); UpdateControlFile();
SpinRelease(ControlFileLockId); SpinRelease(ControlFileLockId);
#ifdef XLOG
/* /*
* Delete offline log files. Get oldest online * Delete offline log files. Get oldest online
* log file from undo rec if it's valid. * log file from undo rec if it's valid.
...@@ -1948,7 +1917,6 @@ CreateCheckPoint(bool shutdown) ...@@ -1948,7 +1917,6 @@ CreateCheckPoint(bool shutdown)
S_UNLOCK(&(XLogCtl->chkp_lck)); S_UNLOCK(&(XLogCtl->chkp_lck));
MyLastRecPtr.xrecoff = 0; /* to avoid commit record */ MyLastRecPtr.xrecoff = 0; /* to avoid commit record */
#endif
return; return;
} }
......
/*-------------------------------------------------------------------------
*
* varsup.c
* postgres OID & XID variables support routines
*
* Copyright (c) 2000, PostgreSQL, Inc
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/xlog_varsup.c,v 1.1 2000/11/03 11:39:35 vadim Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "access/transam.h"
#include "storage/proc.h"
SPINLOCK OidGenLockId;
extern SPINLOCK XidGenLockId;
extern void XLogPutNextOid(Oid nextOid);
/* pointer to "variable cache" in shared memory (set up by shmem.c) */
VariableCache ShmemVariableCache = NULL;
void
GetNewTransactionId(TransactionId *xid)
{
/*
* During bootstrap initialization, we return the special
* bootstrap transaction id.
*/
if (AMI_OVERRIDE)
{
*xid = AmiTransactionId;
return;
}
SpinAcquire(XidGenLockId);
*xid = ShmemVariableCache->nextXid;
(ShmemVariableCache->nextXid)++;
if (MyProc != (PROC *) NULL)
MyProc->xid = *xid;
SpinRelease(XidGenLockId);
}
/*
* Like GetNewTransactionId reads nextXid but don't fetch it.
*/
void
ReadNewTransactionId(TransactionId *xid)
{
/*
* During bootstrap initialization, we return the special
* bootstrap transaction id.
*/
if (AMI_OVERRIDE)
{
*xid = AmiTransactionId;
return;
}
SpinAcquire(XidGenLockId);
*xid = ShmemVariableCache->nextXid;
SpinRelease(XidGenLockId);
}
/* ----------------------------------------------------------------
* object id generation support
* ----------------------------------------------------------------
*/
#define VAR_OID_PREFETCH 8192
static Oid lastSeenOid = InvalidOid;
void
GetNewObjectId(Oid *oid_return)
{
SpinAcquire(OidGenLockId);
/* If we run out of logged for use oids then we log more */
if (ShmemVariableCache->oidCount == 0)
{
XLogPutNextOid(ShmemVariableCache->nextOid + VAR_OID_PREFETCH);
ShmemVariableCache->oidCount = VAR_OID_PREFETCH;
}
if (PointerIsValid(oid_return))
lastSeenOid = (*oid_return) = ShmemVariableCache->nextOid;
(ShmemVariableCache->nextOid)++;
(ShmemVariableCache->oidCount)--;
SpinRelease(OidGenLockId);
}
void
CheckMaxObjectId(Oid assigned_oid)
{
if (lastSeenOid != InvalidOid && assigned_oid < lastSeenOid)
return;
SpinAcquire(OidGenLockId);
if (assigned_oid < ShmemVariableCache->nextOid)
{
lastSeenOid = ShmemVariableCache->nextOid - 1;
SpinRelease(OidGenLockId);
return;
}
/* If we are in the logged oid range, just bump nextOid up */
if (assigned_oid <= ShmemVariableCache->nextOid +
ShmemVariableCache->oidCount - 1)
{
ShmemVariableCache->oidCount -=
assigned_oid - ShmemVariableCache->nextOid + 1;
ShmemVariableCache->nextOid = assigned_oid + 1;
SpinRelease(OidGenLockId);
return;
}
/*
* We have exceeded the logged oid range.
* We should lock the database and kill all other backends
* but we are loading oid's that we can not guarantee are unique
* anyway, so we must rely on the user.
*/
XLogPutNextOid(assigned_oid + VAR_OID_PREFETCH);
ShmemVariableCache->oidCount = VAR_OID_PREFETCH - 1;
ShmemVariableCache->nextOid = assigned_oid + 1;
SpinRelease(OidGenLockId);
}
...@@ -10,9 +10,6 @@ ...@@ -10,9 +10,6 @@
*/ */
#include "postgres.h" #include "postgres.h"
#ifdef XLOG
#include "access/xlog.h" #include "access/xlog.h"
#include "access/transam.h" #include "access/transam.h"
#include "access/xact.h" #include "access/xact.h"
...@@ -397,5 +394,3 @@ XLogOpenRelation(bool redo, RmgrId rmid, RelFileNode rnode) ...@@ -397,5 +394,3 @@ XLogOpenRelation(bool redo, RmgrId rmid, RelFileNode rnode)
return(&(res->reldata)); return(&(res->reldata));
} }
#endif
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.69 2000/11/18 03:36:48 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.70 2000/11/30 08:46:22 vadim Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -153,13 +153,11 @@ createdb(const char *dbname, const char *dbpath, ...@@ -153,13 +153,11 @@ createdb(const char *dbname, const char *dbpath,
elog(ERROR, "database path may not contain single quotes"); elog(ERROR, "database path may not contain single quotes");
/* ... otherwise we'd be open to shell exploits below */ /* ... otherwise we'd be open to shell exploits below */
#ifdef XLOG
/* Force dirty buffers out to disk, to ensure source database is /* Force dirty buffers out to disk, to ensure source database is
* up-to-date for the copy. (We really only need to flush buffers * up-to-date for the copy. (We really only need to flush buffers
* for the source database...) * for the source database...)
*/ */
BufferSync(); BufferSync();
#endif
/* /*
* Close virtual file descriptors so the kernel has more available for * Close virtual file descriptors so the kernel has more available for
...@@ -255,13 +253,11 @@ createdb(const char *dbname, const char *dbpath, ...@@ -255,13 +253,11 @@ createdb(const char *dbname, const char *dbpath,
/* Close pg_database, but keep lock till commit */ /* Close pg_database, but keep lock till commit */
heap_close(pg_database_rel, NoLock); heap_close(pg_database_rel, NoLock);
#ifdef XLOG
/* Force dirty buffers out to disk, so that newly-connecting backends /* Force dirty buffers out to disk, so that newly-connecting backends
* will see the new database in pg_database right away. (They'll see * will see the new database in pg_database right away. (They'll see
* an uncommitted tuple, but they don't care; see GetRawDatabaseInfo.) * an uncommitted tuple, but they don't care; see GetRawDatabaseInfo.)
*/ */
BufferSync(); BufferSync();
#endif
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.173 2000/11/16 22:30:19 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.174 2000/11/30 08:46:22 vadim Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
...@@ -47,11 +47,9 @@ ...@@ -47,11 +47,9 @@
#include <sys/resource.h> #include <sys/resource.h>
#endif #endif
#ifdef XLOG
#include "access/xlog.h" #include "access/xlog.h"
XLogRecPtr log_heap_move(Relation reln, extern XLogRecPtr log_heap_move(Relation reln,
ItemPointerData from, HeapTuple newtup); ItemPointerData from, HeapTuple newtup);
#endif
static MemoryContext vac_context = NULL; static MemoryContext vac_context = NULL;
...@@ -1492,7 +1490,6 @@ repair_frag(VRelStats *vacrelstats, Relation onerel, ...@@ -1492,7 +1490,6 @@ repair_frag(VRelStats *vacrelstats, Relation onerel,
newtup.t_data = (HeapTupleHeader) PageGetItem(ToPage, newitemid); newtup.t_data = (HeapTupleHeader) PageGetItem(ToPage, newitemid);
ItemPointerSet(&(newtup.t_self), destvacpage->blkno, newoff); ItemPointerSet(&(newtup.t_self), destvacpage->blkno, newoff);
#ifdef XLOG
{ {
XLogRecPtr recptr = XLogRecPtr recptr =
log_heap_move(onerel, tuple.t_self, &newtup); log_heap_move(onerel, tuple.t_self, &newtup);
...@@ -1505,7 +1502,6 @@ repair_frag(VRelStats *vacrelstats, Relation onerel, ...@@ -1505,7 +1502,6 @@ repair_frag(VRelStats *vacrelstats, Relation onerel,
PageSetLSN(ToPage, recptr); PageSetLSN(ToPage, recptr);
PageSetSUI(ToPage, ThisStartUpID); PageSetSUI(ToPage, ThisStartUpID);
} }
#endif
if (((int) destvacpage->blkno) > last_move_dest_block) if (((int) destvacpage->blkno) > last_move_dest_block)
last_move_dest_block = destvacpage->blkno; last_move_dest_block = destvacpage->blkno;
...@@ -1655,7 +1651,6 @@ failed to add item with len = %lu to page %u (free space %lu, nusd %u, noff %u)" ...@@ -1655,7 +1651,6 @@ failed to add item with len = %lu to page %u (free space %lu, nusd %u, noff %u)"
~(HEAP_XMIN_COMMITTED | HEAP_XMIN_INVALID | HEAP_MOVED_IN); ~(HEAP_XMIN_COMMITTED | HEAP_XMIN_INVALID | HEAP_MOVED_IN);
tuple.t_data->t_infomask |= HEAP_MOVED_OFF; tuple.t_data->t_infomask |= HEAP_MOVED_OFF;
#ifdef XLOG
{ {
XLogRecPtr recptr = XLogRecPtr recptr =
log_heap_move(onerel, tuple.t_self, &newtup); log_heap_move(onerel, tuple.t_self, &newtup);
...@@ -1665,7 +1660,6 @@ failed to add item with len = %lu to page %u (free space %lu, nusd %u, noff %u)" ...@@ -1665,7 +1660,6 @@ failed to add item with len = %lu to page %u (free space %lu, nusd %u, noff %u)"
PageSetLSN(ToPage, recptr); PageSetLSN(ToPage, recptr);
PageSetSUI(ToPage, ThisStartUpID); PageSetSUI(ToPage, ThisStartUpID);
} }
#endif
cur_page->offsets_used++; cur_page->offsets_used++;
num_moved++; num_moved++;
...@@ -1786,19 +1780,12 @@ failed to add item with len = %lu to page %u (free space %lu, nusd %u, noff %u)" ...@@ -1786,19 +1780,12 @@ failed to add item with len = %lu to page %u (free space %lu, nusd %u, noff %u)"
if (num_moved > 0) if (num_moved > 0)
{ {
#ifdef XLOG
RecordTransactionCommit();
#else
/* /*
* We have to commit our tuple' movings before we'll truncate * We have to commit our tuple' movings before we'll truncate
* relation, but we shouldn't lose our locks. And so - quick hack: * relation, but we shouldn't lose our locks. And so - quick hack:
* flush buffers and record status of current transaction as * record status of current transaction as committed, and continue.
* committed, and continue. - vadim 11/13/96
*/ */
FlushBufferPool(); RecordTransactionCommit();
TransactionIdCommit(myXID);
FlushBufferPool();
#endif
} }
/* /*
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.67 2000/11/23 01:08:57 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.68 2000/11/30 08:46:23 vadim Exp $
* *
* NOTES: * NOTES:
* *
...@@ -192,20 +192,6 @@ static File fileNameOpenFile(FileName fileName, int fileFlags, int fileMode); ...@@ -192,20 +192,6 @@ static File fileNameOpenFile(FileName fileName, int fileFlags, int fileMode);
static char *filepath(char *filename); static char *filepath(char *filename);
static long pg_nofile(void); static long pg_nofile(void);
#ifndef XLOG
/*
* pg_fsync --- same as fsync except does nothing if -F switch was given
*/
int
pg_fsync(int fd)
{
if (enableFsync)
return fsync(fd);
else
return 0;
}
#endif
/* /*
* BasicOpenFile --- same as open(2) except can free other FDs if needed * BasicOpenFile --- same as open(2) except can free other FDs if needed
* *
...@@ -665,7 +651,6 @@ fileNameOpenFile(FileName fileName, ...@@ -665,7 +651,6 @@ fileNameOpenFile(FileName fileName,
vfdP->fileFlags = fileFlags & ~(O_TRUNC | O_EXCL); vfdP->fileFlags = fileFlags & ~(O_TRUNC | O_EXCL);
vfdP->fileMode = fileMode; vfdP->fileMode = fileMode;
vfdP->seekPos = 0; vfdP->seekPos = 0;
#ifdef XLOG
/* /*
* Have to fsync file on commit. Alternative way - log * Have to fsync file on commit. Alternative way - log
* file creation and fsync log before actual file creation. * file creation and fsync log before actual file creation.
...@@ -673,7 +658,6 @@ fileNameOpenFile(FileName fileName, ...@@ -673,7 +658,6 @@ fileNameOpenFile(FileName fileName,
if (fileFlags & O_CREAT) if (fileFlags & O_CREAT)
vfdP->fdstate = FD_DIRTY; vfdP->fdstate = FD_DIRTY;
else else
#endif
vfdP->fdstate = 0x0; vfdP->fdstate = 0x0;
return file; return file;
...@@ -832,13 +816,7 @@ FileWrite(File file, char *buffer, int amount) ...@@ -832,13 +816,7 @@ FileWrite(File file, char *buffer, int amount)
FileAccess(file); FileAccess(file);
returnCode = write(VfdCache[file].fd, buffer, amount); returnCode = write(VfdCache[file].fd, buffer, amount);
if (returnCode > 0) if (returnCode > 0)
{
VfdCache[file].seekPos += returnCode; VfdCache[file].seekPos += returnCode;
#ifndef XLOG
/* mark the file as needing fsync */
VfdCache[file].fdstate |= FD_DIRTY;
#endif
}
else else
VfdCache[file].seekPos = FileUnknownPos; VfdCache[file].seekPos = FileUnknownPos;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.79 2000/11/10 03:53:45 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.80 2000/11/30 08:46:24 vadim Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -569,14 +569,6 @@ mdblindwrt(RelFileNode rnode, ...@@ -569,14 +569,6 @@ mdblindwrt(RelFileNode rnode,
elog(DEBUG, "mdblindwrt: write() failed: %m"); elog(DEBUG, "mdblindwrt: write() failed: %m");
status = SM_FAIL; status = SM_FAIL;
} }
#ifndef XLOG
else if (dofsync &&
pg_fsync(fd) < 0)
{
elog(DEBUG, "mdblindwrt: fsync() failed: %m");
status = SM_FAIL;
}
#endif
if (close(fd) < 0) if (close(fd) < 0)
{ {
...@@ -840,7 +832,6 @@ mdabort() ...@@ -840,7 +832,6 @@ mdabort()
return SM_SUCCESS; return SM_SUCCESS;
} }
#ifdef XLOG
/* /*
* mdsync() -- Sync storage. * mdsync() -- Sync storage.
* *
...@@ -854,7 +845,6 @@ mdsync() ...@@ -854,7 +845,6 @@ mdsync()
sync(); sync();
return SM_SUCCESS; return SM_SUCCESS;
} }
#endif
/* /*
* _fdvec_alloc () -- grab a free (or new) md file descriptor vector. * _fdvec_alloc () -- grab a free (or new) md file descriptor vector.
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.45 2000/11/21 21:16:01 petere Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.46 2000/11/30 08:46:24 vadim Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -47,9 +47,7 @@ typedef struct f_smgr ...@@ -47,9 +47,7 @@ typedef struct f_smgr
int (*smgr_truncate) (Relation reln, int nblocks); int (*smgr_truncate) (Relation reln, int nblocks);
int (*smgr_commit) (void); /* may be NULL */ int (*smgr_commit) (void); /* may be NULL */
int (*smgr_abort) (void); /* may be NULL */ int (*smgr_abort) (void); /* may be NULL */
#ifdef XLOG
int (*smgr_sync) (void); int (*smgr_sync) (void);
#endif
} f_smgr; } f_smgr;
/* /*
...@@ -62,11 +60,7 @@ static f_smgr smgrsw[] = { ...@@ -62,11 +60,7 @@ static f_smgr smgrsw[] = {
/* magnetic disk */ /* magnetic disk */
{mdinit, NULL, mdcreate, mdunlink, mdextend, mdopen, mdclose, {mdinit, NULL, mdcreate, mdunlink, mdextend, mdopen, mdclose,
mdread, mdwrite, mdflush, mdblindwrt, mdmarkdirty, mdblindmarkdirty, mdread, mdwrite, mdflush, mdblindwrt, mdmarkdirty, mdblindmarkdirty,
#ifdef XLOG
mdnblocks, mdtruncate, mdcommit, mdabort, mdsync mdnblocks, mdtruncate, mdcommit, mdabort, mdsync
#else
mdnblocks, mdtruncate, mdcommit, mdabort
#endif
}, },
#ifdef STABLE_MEMORY_STORAGE #ifdef STABLE_MEMORY_STORAGE
...@@ -545,7 +539,6 @@ smgrabort() ...@@ -545,7 +539,6 @@ smgrabort()
return SM_SUCCESS; return SM_SUCCESS;
} }
#ifdef XLOG
int int
smgrsync() smgrsync()
{ {
...@@ -564,7 +557,6 @@ smgrsync() ...@@ -564,7 +557,6 @@ smgrsync()
return SM_SUCCESS; return SM_SUCCESS;
} }
#endif
#ifdef NOT_USED #ifdef NOT_USED
bool bool
...@@ -578,8 +570,6 @@ smgriswo(int16 smgrno) ...@@ -578,8 +570,6 @@ smgriswo(int16 smgrno)
#endif #endif
#ifdef XLOG
void void
smgr_redo(XLogRecPtr lsn, XLogRecord *record) smgr_redo(XLogRecPtr lsn, XLogRecord *record)
{ {
...@@ -594,4 +584,3 @@ void ...@@ -594,4 +584,3 @@ void
smgr_desc(char *buf, uint8 xl_info, char* rec) smgr_desc(char *buf, uint8 xl_info, char* rec)
{ {
} }
#endif
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.116 2000/11/10 00:33:10 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.117 2000/11/30 08:46:24 vadim Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -2027,8 +2027,7 @@ RelationCacheInitializePhase2(void) ...@@ -2027,8 +2027,7 @@ RelationCacheInitializePhase2(void)
} }
} }
#ifdef XLOG /* used by XLogInitCache */ /* used by XLogInitCache */
void CreateDummyCaches(void); void CreateDummyCaches(void);
void DestroyDummyCaches(void); void DestroyDummyCaches(void);
...@@ -2082,8 +2081,6 @@ DestroyDummyCaches(void) ...@@ -2082,8 +2081,6 @@ DestroyDummyCaches(void)
MemoryContextSwitchTo(oldcxt); MemoryContextSwitchTo(oldcxt);
} }
#endif /* XLOG */
static void static void
AttrDefaultFetch(Relation relation) AttrDefaultFetch(Relation relation)
{ {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.73 2000/11/28 23:27:57 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.74 2000/11/30 08:46:25 vadim Exp $
* *
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
...@@ -177,11 +177,6 @@ InitPostgres(const char *dbname, const char *username) ...@@ -177,11 +177,6 @@ InitPostgres(const char *dbname, const char *username)
{ {
bool bootstrap = IsBootstrapProcessingMode(); bool bootstrap = IsBootstrapProcessingMode();
#ifndef XLOG
if (!TransactionFlushEnabled())
on_shmem_exit(FlushBufferPool, 0);
#endif
SetDatabaseName(dbname); SetDatabaseName(dbname);
/* ---------------- /* ----------------
* initialize the database id used for system caches and lock tables * initialize the database id used for system caches and lock tables
...@@ -190,11 +185,7 @@ InitPostgres(const char *dbname, const char *username) ...@@ -190,11 +185,7 @@ InitPostgres(const char *dbname, const char *username)
if (bootstrap) if (bootstrap)
{ {
MyDatabaseId = TemplateDbOid; MyDatabaseId = TemplateDbOid;
#ifdef OLD_FILE_NAMING
SetDatabasePath(ExpandDatabasePath(dbname));
#else
SetDatabasePath(GetDatabasePath(MyDatabaseId)); SetDatabasePath(GetDatabasePath(MyDatabaseId));
#endif
LockDisable(true); LockDisable(true);
} }
else else
...@@ -228,13 +219,7 @@ InitPostgres(const char *dbname, const char *username) ...@@ -228,13 +219,7 @@ InitPostgres(const char *dbname, const char *username)
"Database \"%s\" does not exist in the system catalog.", "Database \"%s\" does not exist in the system catalog.",
dbname); dbname);
#ifdef OLD_FILE_NAMING
fullpath = ExpandDatabasePath(datpath);
if (!fullpath)
elog(FATAL, "Database path could not be resolved.");
#else
fullpath = GetDatabasePath(MyDatabaseId); fullpath = GetDatabasePath(MyDatabaseId);
#endif
/* Verify the database path */ /* Verify the database path */
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: htup.h,v 1.40 2000/11/30 01:47:32 vadim Exp $ * $Id: htup.h,v 1.41 2000/11/30 08:46:25 vadim Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -63,11 +63,6 @@ typedef struct HeapTupleHeaderData ...@@ -63,11 +63,6 @@ typedef struct HeapTupleHeaderData
typedef HeapTupleHeaderData *HeapTupleHeader; typedef HeapTupleHeaderData *HeapTupleHeader;
#ifdef XLOG
/* XLOG stuff */
/* /*
* XLOG allows to store some information in high 4 bits of log * XLOG allows to store some information in high 4 bits of log
* record xl_info field * record xl_info field
...@@ -127,11 +122,6 @@ typedef struct xl_heap_update ...@@ -127,11 +122,6 @@ typedef struct xl_heap_update
#define SizeOfHeapUpdate (offsetof(xl_heap_update, mask) + sizeof(uint8)) #define SizeOfHeapUpdate (offsetof(xl_heap_update, mask) + sizeof(uint8))
/* end of XLOG stuff */
#endif /* XLOG */
/* /*
* MaxTupleSize is the maximum allowed size of a tuple, including header and * MaxTupleSize is the maximum allowed size of a tuple, including header and
* MAXALIGN alignment padding. Basically it's BLCKSZ minus the other stuff * MAXALIGN alignment padding. Basically it's BLCKSZ minus the other stuff
...@@ -147,7 +137,6 @@ typedef struct xl_heap_update ...@@ -147,7 +137,6 @@ typedef struct xl_heap_update
#define MaxTupleSize \ #define MaxTupleSize \
(BLCKSZ - MAXALIGN(sizeof(PageHeaderData) + MaxSpecialSpace)) (BLCKSZ - MAXALIGN(sizeof(PageHeaderData) + MaxSpecialSpace))
/* /*
* MaxAttrSize is a somewhat arbitrary upper limit on the declared size of * MaxAttrSize is a somewhat arbitrary upper limit on the declared size of
* data fields of char(n) and similar types. It need not have anything * data fields of char(n) and similar types. It need not have anything
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#ifndef XLOG_UTILS_H #ifndef XLOG_UTILS_H
#define XLOG_UTILS_H
#include "access/rmgr.h" #include "access/rmgr.h"
#include "utils/rel.h" #include "utils/rel.h"
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* or in config.h afterwards. Of course, if you edit config.h, then your * or in config.h afterwards. Of course, if you edit config.h, then your
* changes will be overwritten the next time you run configure. * changes will be overwritten the next time you run configure.
* *
* $Id: config.h.in,v 1.150 2000/11/29 20:59:54 tgl Exp $ * $Id: config.h.in,v 1.151 2000/11/30 08:46:25 vadim Exp $
*/ */
#ifndef CONFIG_H #ifndef CONFIG_H
...@@ -234,9 +234,6 @@ ...@@ -234,9 +234,6 @@
# define HAVE_UNIX_SOCKETS 1 # define HAVE_UNIX_SOCKETS 1
#endif #endif
/* Enable WAL. Don't disable this, it was only used during development. */
#define XLOG 1
/* /*
*------------------------------------------------------------------------ *------------------------------------------------------------------------
* These hand-configurable symbols are for enabling debugging code, * These hand-configurable symbols are for enabling debugging code,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment