Remove some pre-WAL relics:
authorBruce Momjian
Sat, 15 Jun 2002 19:55:38 +0000 (19:55 +0000)
committerBruce Momjian
Sat, 15 Jun 2002 19:55:38 +0000 (19:55 +0000)
  SharedBufferChanged
  BufferRelidLastDirtied
  BufferTagLastDirtied
  BufferDirtiedByMe

Manfred Koizar

src/backend/access/transam/xact.c
src/backend/storage/buffer/buf_init.c
src/backend/storage/buffer/bufmgr.c
src/include/storage/buf_internals.h

index 0159295cf565bb004753d68cdb6e2baaaf37c64f..966f0a0c16880365b34e501019668b1c7a2a294c 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.126 2002/06/11 13:40:50 wieck Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.127 2002/06/15 19:55:37 momjian Exp $
  *
  * NOTES
  *     Transaction aborts can now occur two ways:
 #include "pgstat.h"
 
 
-extern bool SharedBufferChanged;
-
 static void AbortTransaction(void);
 static void AtAbort_Cache(void);
 static void AtAbort_Locks(void);
@@ -991,8 +989,6 @@ CommitTransaction(void)
    AtCommit_Memory();
    AtEOXact_Files();
 
-   SharedBufferChanged = false;    /* safest place to do it */
-
    /* Count transaction commit in statistics collector */
    pgstat_count_xact_commit();
 
@@ -1094,8 +1090,6 @@ AbortTransaction(void)
    AtEOXact_Files();
    AtAbort_Locks();
 
-   SharedBufferChanged = false;    /* safest place to do it */
-
    /* Count transaction abort in statistics collector */
    pgstat_count_xact_rollback();
 
index 37570e6b118bc6e6555e7d485797bfae36198c68..97786e0adb6d7b24390e74caf219fc0d22956fbf 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/storage/buffer/buf_init.c,v 1.47 2001/11/05 17:46:27 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/storage/buffer/buf_init.c,v 1.48 2002/06/15 19:55:37 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -60,9 +60,6 @@ Block    *BufferBlockPointers;
 
 long      *PrivateRefCount;    /* also used in freelist.c */
 bits8     *BufferLocks;        /* flag bits showing locks I have set */
-BufferTag  *BufferTagLastDirtied;      /* tag buffer had when last
-                                        * dirtied by me */
-bool      *BufferDirtiedByMe;  /* T if buf has been dirtied in cur xact */
 
 
 /*
@@ -235,9 +232,6 @@ InitBufferPoolAccess(void)
    BufferBlockPointers = (Block *) calloc(NBuffers, sizeof(Block));
    PrivateRefCount = (long *) calloc(NBuffers, sizeof(long));
    BufferLocks = (bits8 *) calloc(NBuffers, sizeof(bits8));
-   BufferTagLastDirtied = (BufferTag *) calloc(NBuffers, sizeof(BufferTag));
-   BufferDirtiedByMe = (bool *) calloc(NBuffers, sizeof(bool));
-
    /*
     * Convert shmem offsets into addresses as seen by this process. This
     * is just to speed up the BufferGetBlock() macro.
index 7546fc3746811668ec58fd69cc34d2ef8dd40e19..639f957826489b99ad236503c76a04079005f70e 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.123 2002/04/15 23:47:12 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.124 2002/06/15 19:55:37 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -67,15 +67,6 @@ extern long int LocalBufferHitCount;
 extern long int BufferFlushCount;
 extern long int LocalBufferFlushCount;
 
-/*
- * It's used to avoid disk writes for read-only transactions
- * (i.e. when no one shared buffer was changed by transaction).
- * We set it to true in WriteBuffer/WriteNoReleaseBuffer when
- * marking shared buffer as dirty. We set it to false in xact.c
- * after transaction is committed/aborted.
- */
-bool       SharedBufferChanged = false;
-
 static void WaitIO(BufferDesc *buf);
 static void StartBufferIO(BufferDesc *buf, bool forInput);
 static void TerminateBufferIO(BufferDesc *buf);
@@ -593,8 +584,6 @@ WriteBuffer(Buffer buffer)
 
    bufHdr = &BufferDescriptors[buffer - 1];
 
-   SharedBufferChanged = true;
-
    LWLockAcquire(BufMgrLock, LW_EXCLUSIVE);
    Assert(bufHdr->refcount > 0);
 
@@ -623,8 +612,6 @@ WriteNoReleaseBuffer(Buffer buffer)
 
    bufHdr = &BufferDescriptors[buffer - 1];
 
-   SharedBufferChanged = true;
-
    LWLockAcquire(BufMgrLock, LW_EXCLUSIVE);
    Assert(bufHdr->refcount > 0);
 
@@ -1901,12 +1888,9 @@ _bm_die(Oid dbId, Oid relId, int blkNo, int bufNo,
  *
  * Mark a buffer dirty when we have updated tuple commit-status bits in it.
  *
- * This is similar to WriteNoReleaseBuffer, except that we do not set
- * SharedBufferChanged or BufferDirtiedByMe, because we have not made a
+ * This is similar to WriteNoReleaseBuffer, except that we have not made a
  * critical change that has to be flushed to disk before xact commit --- the
- * status-bit update could be redone by someone else just as easily.  The
- * buffer will be marked dirty, but it will not be written to disk until
- * there is another reason to write it.
+ * status-bit update could be redone by someone else just as easily.
  *
  * This routine might get called many times on the same page, if we are making
  * the first scan after commit of an xact that added/deleted many tuples.
index 73033c556b5491a2e489cfcd8b1c24881ed9613a..192895b65f53d70ae38a0e101b2a3211f4dcf175 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $Id: buf_internals.h,v 1.54 2001/11/05 17:46:35 momjian Exp $
+ * $Id: buf_internals.h,v 1.55 2002/06/15 19:55:38 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -170,9 +170,6 @@ extern bool BufTableInsert(BufferDesc *buf);
 /* bufmgr.c */
 extern BufferDesc *BufferDescriptors;
 extern bits8 *BufferLocks;
-extern BufferTag *BufferTagLastDirtied;
-extern LockRelId *BufferRelidLastDirtied;
-extern bool *BufferDirtiedByMe;
 
 /* localbuf.c */
 extern BufferDesc *LocalBufferDescriptors;