#include "pgstat.h"
-extern bool SharedBufferChanged;
-
static void AbortTransaction(void);
static void AtAbort_Cache(void);
static void AtAbort_Locks(void);
AtCommit_Memory();
AtEOXact_Files();
- SharedBufferChanged = false; /* safest place to do it */
-
/* Count transaction commit in statistics collector */
pgstat_count_xact_commit();
AtEOXact_Files();
AtAbort_Locks();
- SharedBufferChanged = false; /* safest place to do it */
-
/* Count transaction abort in statistics collector */
pgstat_count_xact_rollback();
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 */
/*
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.
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);
bufHdr = &BufferDescriptors[buffer - 1];
- SharedBufferChanged = true;
-
LWLockAcquire(BufMgrLock, LW_EXCLUSIVE);
Assert(bufHdr->refcount > 0);
bufHdr = &BufferDescriptors[buffer - 1];
- SharedBufferChanged = true;
-
LWLockAcquire(BufMgrLock, LW_EXCLUSIVE);
Assert(bufHdr->refcount > 0);
*
* 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.