PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/slru.h"
#include "access/subtrans.h"
#include "access/transam.h"
#include "miscadmin.h"
#include "pg_trace.h"
#include "utils/guc_hooks.h"
#include "utils/snapmgr.h"
Go to the source code of this file.
Macros | |
#define | SUBTRANS_XACTS_PER_PAGE (BLCKSZ / sizeof(TransactionId)) |
#define | TransactionIdToEntry(xid) ((xid) % (TransactionId) SUBTRANS_XACTS_PER_PAGE) |
#define | SubTransCtl (&SubTransCtlData) |
Functions | |
static int64 | TransactionIdToPage (TransactionId xid) |
static int | ZeroSUBTRANSPage (int64 pageno) |
static bool | SubTransPagePrecedes (int64 page1, int64 page2) |
void | SubTransSetParent (TransactionId xid, TransactionId parent) |
TransactionId | SubTransGetParent (TransactionId xid) |
TransactionId | SubTransGetTopmostTransaction (TransactionId xid) |
static int | SUBTRANSShmemBuffers (void) |
Size | SUBTRANSShmemSize (void) |
void | SUBTRANSShmemInit (void) |
bool | check_subtrans_buffers (int *newval, void **extra, GucSource source) |
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 54 of file subtrans.c.
#define SubTransCtl (&SubTransCtlData) |
Definition at line 74 of file subtrans.c.
#define TransactionIdToEntry | ( | xid | ) | ((xid) % (TransactionId) SUBTRANS_XACTS_PER_PAGE) |
Definition at line 66 of file subtrans.c.
void BootStrapSUBTRANS | ( | void | ) |
Definition at line 270 of file subtrans.c.
References Assert, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), SimpleLruGetBankLock(), SimpleLruWritePage(), SubTransCtl, and ZeroSUBTRANSPage().
Referenced by BootStrapXLOG().
Definition at line 254 of file subtrans.c.
References check_slru_buffers(), and newval.
void CheckPointSUBTRANS | ( | void | ) |
Definition at line 355 of file subtrans.c.
References SimpleLruWriteAll(), and SubTransCtl.
Referenced by CheckPointGuts().
void ExtendSUBTRANS | ( | TransactionId | newestXact | ) |
Definition at line 379 of file subtrans.c.
References FirstNormalTransactionId, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), SimpleLruGetBankLock(), SubTransCtl, TransactionIdEquals, TransactionIdToEntry, TransactionIdToPage(), and ZeroSUBTRANSPage().
Referenced by GetNewTransactionId(), ProcArrayApplyRecoveryInfo(), and RecordKnownAssignedTransactionIds().
void StartupSUBTRANS | ( | TransactionId | oldestActiveXID | ) |
Definition at line 309 of file subtrans.c.
References LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MaxTransactionId, TransamVariablesData::nextXid, SimpleLruGetBankLock(), SubTransCtl, TransactionIdToPage(), TransamVariables, XidFromFullTransactionId, and ZeroSUBTRANSPage().
Referenced by StartupXLOG().
TransactionId SubTransGetParent | ( | TransactionId | xid | ) |
Definition at line 122 of file subtrans.c.
References Assert, InvalidTransactionId, LWLockRelease(), SimpleLruGetBankLock(), SimpleLruReadPage_ReadOnly(), SubTransCtl, TransactionIdFollowsOrEquals(), TransactionIdIsNormal, TransactionIdToEntry, TransactionIdToPage(), and TransactionXmin.
Referenced by SubTransGetTopmostTransaction(), TransactionIdDidAbort(), and TransactionIdDidCommit().
TransactionId SubTransGetTopmostTransaction | ( | TransactionId | xid | ) |
Definition at line 163 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 435 of file subtrans.c.
References FirstNormalTransactionId, SUBTRANS_XACTS_PER_PAGE, and TransactionIdPrecedes().
Referenced by SUBTRANSShmemInit().
void SubTransSetParent | ( | TransactionId | xid, |
TransactionId | parent | ||
) |
Definition at line 85 of file subtrans.c.
References Assert, if(), InvalidTransactionId, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), SimpleLruGetBankLock(), SimpleLruReadPage(), SubTransCtl, TransactionIdFollows(), TransactionIdIsValid, TransactionIdToEntry, and TransactionIdToPage().
Referenced by AssignTransactionId(), ProcArrayApplyXidAssignment(), and ProcessTwoPhaseBuffer().
|
static |
Definition at line 201 of file subtrans.c.
References Max, Min, SimpleLruAutotuneBuffers(), SLRU_MAX_ALLOWED_BUFFERS, and subtransaction_buffers.
Referenced by SUBTRANSShmemInit(), and SUBTRANSShmemSize().
void SUBTRANSShmemInit | ( | void | ) |
Definition at line 220 of file subtrans.c.
References Assert, buf, LWTRANCHE_SUBTRANS_BUFFER, LWTRANCHE_SUBTRANS_SLRU, PGC_POSTMASTER, PGC_S_DYNAMIC_DEFAULT, PGC_S_OVERRIDE, SetConfigOption(), SimpleLruInit(), SlruPagePrecedesUnitTests, snprintf, SUBTRANS_XACTS_PER_PAGE, subtransaction_buffers, SubTransCtl, SubTransPagePrecedes(), SUBTRANSShmemBuffers(), and SYNC_HANDLER_NONE.
Referenced by CreateOrAttachShmemStructs().
Size SUBTRANSShmemSize | ( | void | ) |
Definition at line 214 of file subtrans.c.
References SimpleLruShmemSize(), and SUBTRANSShmemBuffers().
Referenced by CalculateShmemSize().
|
inlinestatic |
Definition at line 61 of file subtrans.c.
References SUBTRANS_XACTS_PER_PAGE.
Referenced by ExtendSUBTRANS(), StartupSUBTRANS(), SubTransGetParent(), SubTransSetParent(), and TruncateSUBTRANS().
void TruncateSUBTRANS | ( | TransactionId | oldestXact | ) |
Definition at line 411 of file subtrans.c.
References SimpleLruTruncate(), SubTransCtl, TransactionIdRetreat, and TransactionIdToPage().
Referenced by CreateCheckPoint(), and CreateRestartPoint().
|
static |
Definition at line 296 of file subtrans.c.
References SimpleLruZeroPage(), and SubTransCtl.
Referenced by BootStrapSUBTRANS(), ExtendSUBTRANS(), and StartupSUBTRANS().
|
static |
Definition at line 72 of file subtrans.c.