PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/slru.h"
#include "access/subtrans.h"
#include "access/transam.h"
#include "pg_trace.h"
#include "utils/snapmgr.h"
Go to the source code of this file.
Macros | |
#define | SUBTRANS_XACTS_PER_PAGE (BLCKSZ / sizeof(TransactionId)) |
#define | TransactionIdToPage(xid) ((xid) / (TransactionId) SUBTRANS_XACTS_PER_PAGE) |
#define | TransactionIdToEntry(xid) ((xid) % (TransactionId) SUBTRANS_XACTS_PER_PAGE) |
#define | SubTransCtl (&SubTransCtlData) |
Functions | |
static int | ZeroSUBTRANSPage (int pageno) |
static bool | SubTransPagePrecedes (int page1, int page2) |
void | SubTransSetParent (TransactionId xid, TransactionId parent) |
TransactionId | SubTransGetParent (TransactionId xid) |
TransactionId | SubTransGetTopmostTransaction (TransactionId xid) |
Size | SUBTRANSShmemSize (void) |
void | SUBTRANSShmemInit (void) |
void | BootStrapSUBTRANS (void) |
void | StartupSUBTRANS (TransactionId oldestActiveXID) |
void | CheckPointSUBTRANS (void) |
void | ExtendSUBTRANS (TransactionId newestXact) |
void | TruncateSUBTRANS (TransactionId oldestXact) |
Variables | |
static SlruCtlData | SubTransCtlData |
#define SUBTRANS_XACTS_PER_PAGE (BLCKSZ / sizeof(TransactionId)) |
Definition at line 52 of file subtrans.c.
#define SubTransCtl (&SubTransCtlData) |
Definition at line 63 of file subtrans.c.
#define TransactionIdToEntry | ( | xid | ) | ((xid) % (TransactionId) SUBTRANS_XACTS_PER_PAGE) |
Definition at line 55 of file subtrans.c.
#define TransactionIdToPage | ( | xid | ) | ((xid) / (TransactionId) SUBTRANS_XACTS_PER_PAGE) |
Definition at line 54 of file subtrans.c.
void BootStrapSUBTRANS | ( | void | ) |
Definition at line 211 of file subtrans.c.
References Assert(), LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), SimpleLruWritePage(), SubTransCtl, and ZeroSUBTRANSPage().
Referenced by BootStrapXLOG().
void CheckPointSUBTRANS | ( | void | ) |
Definition at line 284 of file subtrans.c.
References SimpleLruWriteAll(), and SubTransCtl.
Referenced by CheckPointGuts().
void ExtendSUBTRANS | ( | TransactionId | newestXact | ) |
Definition at line 308 of file subtrans.c.
References FirstNormalTransactionId, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), TransactionIdEquals, TransactionIdToEntry, TransactionIdToPage, and ZeroSUBTRANSPage().
Referenced by GetNewTransactionId(), ProcArrayApplyRecoveryInfo(), and RecordKnownAssignedTransactionIds().
void StartupSUBTRANS | ( | TransactionId | oldestActiveXID | ) |
Definition at line 249 of file subtrans.c.
References LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MaxTransactionId, VariableCacheData::nextXid, ShmemVariableCache, TransactionIdToPage, XidFromFullTransactionId, and ZeroSUBTRANSPage().
Referenced by StartupXLOG().
TransactionId SubTransGetParent | ( | TransactionId | xid | ) |
Definition at line 109 of file subtrans.c.
References Assert(), InvalidTransactionId, LWLockRelease(), SimpleLruReadPage_ReadOnly(), SubTransCtl, TransactionIdFollowsOrEquals(), TransactionIdIsNormal, TransactionIdToEntry, TransactionIdToPage, and TransactionXmin.
Referenced by SubTransGetTopmostTransaction(), TransactionIdDidAbort(), and TransactionIdDidCommit().
TransactionId SubTransGetTopmostTransaction | ( | TransactionId | xid | ) |
Definition at line 150 of file subtrans.c.
References Assert(), elog(), ERROR, SubTransGetParent(), TransactionIdFollowsOrEquals(), TransactionIdIsValid, TransactionIdPrecedes(), and TransactionXmin.
Referenced by ConditionalXactLockTableWait(), HeapCheckForSerializableConflictOut(), TransactionIdIsInProgress(), XactLockTableWait(), and XidInMVCCSnapshot().
|
static |
Definition at line 362 of file subtrans.c.
References FirstNormalTransactionId, SUBTRANS_XACTS_PER_PAGE, and TransactionIdPrecedes().
Referenced by SUBTRANSShmemInit().
void SubTransSetParent | ( | TransactionId | xid, |
TransactionId | parent | ||
) |
Definition at line 74 of file subtrans.c.
References Assert(), if(), InvalidTransactionId, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), SimpleLruReadPage(), SubTransCtl, TransactionIdFollows(), TransactionIdIsValid, TransactionIdToEntry, and TransactionIdToPage.
Referenced by AssignTransactionId(), ProcArrayApplyXidAssignment(), and ProcessTwoPhaseBuffer().
void SUBTRANSShmemInit | ( | void | ) |
Definition at line 191 of file subtrans.c.
References LWTRANCHE_SUBTRANS_BUFFER, NUM_SUBTRANS_BUFFERS, SimpleLruInit(), SlruPagePrecedesUnitTests, SUBTRANS_XACTS_PER_PAGE, SubTransCtl, SubTransPagePrecedes(), and SYNC_HANDLER_NONE.
Referenced by CreateSharedMemoryAndSemaphores().
Size SUBTRANSShmemSize | ( | void | ) |
Definition at line 185 of file subtrans.c.
References NUM_SUBTRANS_BUFFERS, and SimpleLruShmemSize().
Referenced by CalculateShmemSize().
void TruncateSUBTRANS | ( | TransactionId | oldestXact | ) |
Definition at line 338 of file subtrans.c.
References SimpleLruTruncate(), SubTransCtl, TransactionIdRetreat, and TransactionIdToPage.
Referenced by CreateCheckPoint(), and CreateRestartPoint().
|
static |
Definition at line 236 of file subtrans.c.
References SimpleLruZeroPage(), and SubTransCtl.
Referenced by BootStrapSUBTRANS(), ExtendSUBTRANS(), and StartupSUBTRANS().
|
static |
Definition at line 61 of file subtrans.c.