PostgreSQL Source Code
git master
|
#include "access/xlog.h"
#include "datatype/timestamp.h"
#include "replication/origin.h"
#include "storage/sync.h"
Go to the source code of this file.
Data Structures | |
struct | xl_commit_ts_set |
struct | xl_commit_ts_truncate |
Macros | |
#define | COMMIT_TS_ZEROPAGE 0x00 |
#define | COMMIT_TS_TRUNCATE 0x10 |
#define | SizeOfCommitTsSet |
#define | SizeOfCommitTsTruncate |
Typedefs | |
typedef struct xl_commit_ts_set | xl_commit_ts_set |
typedef struct xl_commit_ts_truncate | xl_commit_ts_truncate |
Variables | |
PGDLLIMPORT bool | track_commit_timestamp |
#define COMMIT_TS_TRUNCATE 0x10 |
Definition at line 47 of file commit_ts.h.
#define COMMIT_TS_ZEROPAGE 0x00 |
Definition at line 46 of file commit_ts.h.
#define SizeOfCommitTsSet |
Definition at line 57 of file commit_ts.h.
#define SizeOfCommitTsTruncate |
Definition at line 66 of file commit_ts.h.
typedef struct xl_commit_ts_set xl_commit_ts_set |
typedef struct xl_commit_ts_truncate xl_commit_ts_truncate |
void AdvanceOldestCommitTsXid | ( | TransactionId | oldestXact | ) |
Definition at line 936 of file commit_ts.c.
References InvalidTransactionId, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), TransamVariablesData::oldestCommitTsXid, TransactionIdPrecedes(), and TransamVariables.
Referenced by commit_ts_redo(), and vac_truncate_clog().
void BootStrapCommitTs | ( | void | ) |
void CheckPointCommitTs | ( | void | ) |
Definition at line 820 of file commit_ts.c.
References CommitTsCtl, and SimpleLruWriteAll().
Referenced by CheckPointGuts().
void commit_ts_desc | ( | StringInfo | buf, |
XLogReaderState * | record | ||
) |
Definition at line 21 of file committsdesc.c.
References appendStringInfo(), buf, COMMIT_TS_TRUNCATE, COMMIT_TS_ZEROPAGE, xl_commit_ts_truncate::oldestXid, xl_commit_ts_truncate::pageno, XLogRecGetData, XLogRecGetInfo, and XLR_INFO_MASK.
const char* commit_ts_identify | ( | uint8 | info | ) |
Definition at line 43 of file committsdesc.c.
References COMMIT_TS_TRUNCATE, and COMMIT_TS_ZEROPAGE.
void commit_ts_redo | ( | XLogReaderState * | record | ) |
Definition at line 1016 of file commit_ts.c.
References AdvanceOldestCommitTsXid(), Assert, COMMIT_TS_TRUNCATE, COMMIT_TS_ZEROPAGE, CommitTsCtl, elog, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), xl_commit_ts_truncate::oldestXid, xl_commit_ts_truncate::pageno, PANIC, pg_atomic_write_u64(), SimpleLruGetBankLock(), SimpleLruTruncate(), SimpleLruWritePage(), XLogRecGetData, XLogRecGetInfo, XLogRecHasAnyBlockRefs, XLR_INFO_MASK, and ZeroCommitTsPage().
Definition at line 664 of file commit_ts.c.
References ActivateCommitTs(), CommitTimestampShared::commitTsActive, commitTsShared, and DeactivateCommitTs().
Referenced by xlog_redo().
void CommitTsShmemInit | ( | void | ) |
Definition at line 530 of file commit_ts.c.
References Assert, buf, commit_timestamp_buffers, COMMIT_TS_XACTS_PER_PAGE, CommitTimestampShared::commitTsActive, CommitTsCtl, CommitTsPagePrecedes(), commitTsShared, CommitTsShmemBuffers(), CommitTimestampShared::dataLastCommit, InvalidRepOriginId, InvalidTransactionId, IsUnderPostmaster, LWTRANCHE_COMMITTS_BUFFER, LWTRANCHE_COMMITTS_SLRU, CommitTimestampEntry::nodeid, PGC_POSTMASTER, PGC_S_DYNAMIC_DEFAULT, PGC_S_OVERRIDE, SetConfigOption(), ShmemInitStruct(), SimpleLruInit(), SlruPagePrecedesUnitTests, snprintf, SYNC_HANDLER_COMMIT_TS, CommitTimestampEntry::time, TIMESTAMP_NOBEGIN, and CommitTimestampShared::xidLastCommit.
Referenced by CreateOrAttachShmemStructs().
Size CommitTsShmemSize | ( | void | ) |
Definition at line 519 of file commit_ts.c.
References CommitTsShmemBuffers(), and SimpleLruShmemSize().
Referenced by CalculateShmemSize().
int committssyncfiletag | ( | const FileTag * | ftag, |
char * | path | ||
) |
Definition at line 1063 of file commit_ts.c.
References CommitTsCtl, and SlruSyncFileTag().
void CompleteCommitTsInitialization | ( | void | ) |
Definition at line 642 of file commit_ts.c.
References ActivateCommitTs(), DeactivateCommitTs(), and track_commit_timestamp.
Referenced by StartupXLOG().
void ExtendCommitTs | ( | TransactionId | newestXact | ) |
Definition at line 842 of file commit_ts.c.
References Assert, CommitTimestampShared::commitTsActive, CommitTsCtl, commitTsShared, FirstNormalTransactionId, InRecovery, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), SimpleLruGetBankLock(), TransactionIdEquals, TransactionIdToCTsEntry, TransactionIdToCTsPage(), and ZeroCommitTsPage().
Referenced by GetNewTransactionId().
TransactionId GetLatestCommitTsData | ( | TimestampTz * | ts, |
RepOriginId * | nodeid | ||
) |
Definition at line 360 of file commit_ts.c.
References CommitTimestampShared::commitTsActive, commitTsShared, CommitTimestampShared::dataLastCommit, error_commit_ts_disabled(), LW_SHARED, LWLockAcquire(), LWLockRelease(), CommitTimestampEntry::nodeid, CommitTimestampEntry::time, and CommitTimestampShared::xidLastCommit.
Referenced by pg_last_committed_xact().
void SetCommitTsLimit | ( | TransactionId | oldestXact, |
TransactionId | newestXact | ||
) |
Definition at line 909 of file commit_ts.c.
References Assert, InvalidTransactionId, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), TransamVariablesData::newestCommitTsXid, TransamVariablesData::oldestCommitTsXid, TransactionIdPrecedes(), and TransamVariables.
Referenced by BootStrapXLOG(), and StartupXLOG().
void StartupCommitTs | ( | void | ) |
Definition at line 632 of file commit_ts.c.
References ActivateCommitTs().
Referenced by StartupXLOG().
bool TransactionIdGetCommitTsData | ( | TransactionId | xid, |
TimestampTz * | ts, | ||
RepOriginId * | nodeid | ||
) |
Definition at line 274 of file commit_ts.c.
References Assert, CommitTimestampShared::commitTsActive, CommitTsCtl, commitTsShared, CommitTimestampShared::dataLastCommit, ereport, errcode(), errmsg(), ERROR, error_commit_ts_disabled(), InvalidRepOriginId, LW_SHARED, LWLockAcquire(), LWLockRelease(), TransamVariablesData::newestCommitTsXid, CommitTimestampEntry::nodeid, TransamVariablesData::oldestCommitTsXid, SimpleLruGetBankLock(), SimpleLruReadPage_ReadOnly(), SizeOfCommitTimestampEntry, CommitTimestampEntry::time, TransactionIdIsNormal, TransactionIdIsValid, TransactionIdPrecedes(), TransactionIdToCTsEntry, TransactionIdToCTsPage(), TransamVariables, and CommitTimestampShared::xidLastCommit.
Referenced by GetTupleTransactionInfo(), pg_xact_commit_timestamp(), and pg_xact_commit_timestamp_origin().
void TransactionTreeSetCommitTsData | ( | TransactionId | xid, |
int | nsubxids, | ||
TransactionId * | subxids, | ||
TimestampTz | timestamp, | ||
RepOriginId | nodeid | ||
) |
Definition at line 141 of file commit_ts.c.
References CommitTimestampShared::commitTsActive, commitTsShared, CommitTimestampShared::dataLastCommit, i, j, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), TransamVariablesData::newestCommitTsXid, CommitTimestampEntry::nodeid, SetXidCommitTsInPage(), CommitTimestampEntry::time, TransactionIdPrecedes(), TransactionIdToCTsPage(), TransamVariables, and CommitTimestampShared::xidLastCommit.
Referenced by RecordTransactionCommit(), RecordTransactionCommitPrepared(), and xact_redo_commit().
void TruncateCommitTs | ( | TransactionId | oldestXact | ) |
Definition at line 883 of file commit_ts.c.
References CommitTsCtl, SimpleLruTruncate(), SlruScanDirCbReportPresence(), SlruScanDirectory(), TransactionIdToCTsPage(), and WriteTruncateXlogRec().
Referenced by vac_truncate_clog().
|
extern |
Definition at line 109 of file commit_ts.c.
Referenced by CompleteCommitTsInitialization(), GetTupleTransactionInfo(), InitControlFile(), and XLogReportParameters().