PostgreSQL Source Code
git master
|
#include "access/xlogdefs.h"
Go to the source code of this file.
Data Structures | |
struct | FullTransactionId |
struct | TransamVariablesData |
Typedefs | |
typedef struct FullTransactionId | FullTransactionId |
typedef struct TransamVariablesData | TransamVariablesData |
Variables | |
PGDLLIMPORT TransamVariablesData * | TransamVariables |
#define AssertTransactionIdInAllowableRange | ( | xid | ) | ((void)true) |
#define BootstrapTransactionId ((TransactionId) 1) |
#define FirstNormalFullTransactionId FullTransactionIdFromEpochAndXid(0, FirstNormalTransactionId) |
#define FirstNormalTransactionId ((TransactionId) 3) |
#define FrozenTransactionId ((TransactionId) 2) |
#define FullTransactionIdIsNormal | ( | x | ) | FullTransactionIdFollowsOrEquals(x, FirstNormalFullTransactionId) |
#define FullTransactionIdIsValid | ( | x | ) | TransactionIdIsValid(XidFromFullTransactionId(x)) |
#define InvalidFullTransactionId FullTransactionIdFromEpochAndXid(0, InvalidTransactionId) |
#define InvalidTransactionId ((TransactionId) 0) |
#define MaxTransactionId ((TransactionId) 0xFFFFFFFF) |
#define NormalTransactionIdFollows | ( | id1, | |
id2 | |||
) |
#define NormalTransactionIdPrecedes | ( | id1, | |
id2 | |||
) |
#define StoreInvalidTransactionId | ( | dest | ) | (*(dest) = InvalidTransactionId) |
#define TransactionIdAdvance | ( | dest | ) |
#define TransactionIdIsNormal | ( | xid | ) | ((xid) >= FirstNormalTransactionId) |
#define TransactionIdIsValid | ( | xid | ) | ((xid) != InvalidTransactionId) |
#define TransactionIdRetreat | ( | dest | ) |
typedef struct FullTransactionId FullTransactionId |
typedef struct TransamVariablesData TransamVariablesData |
void AdvanceNextFullTransactionIdPastXid | ( | TransactionId | xid | ) |
Definition at line 304 of file varsup.c.
References AmStartupProcess, Assert, epoch, EpochFromFullTransactionId, FullTransactionIdFromEpochAndXid(), IsUnderPostmaster, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), TransamVariablesData::nextXid, TransactionIdAdvance, TransactionIdFollowsOrEquals(), TransamVariables, unlikely, and XidFromFullTransactionId.
Referenced by ApplyWalRecord(), multixact_redo(), ProcArrayApplyRecoveryInfo(), ProcessTwoPhaseBuffer(), RecordKnownAssignedTransactionIds(), xact_redo_abort(), and xact_redo_commit().
void AdvanceOldestClogXid | ( | TransactionId | oldest_datfrozenxid | ) |
Definition at line 355 of file varsup.c.
References LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), TransamVariablesData::oldestClogXid, TransactionIdPrecedes(), and TransamVariables.
Referenced by BootStrapXLOG(), clog_redo(), StartupXLOG(), and TruncateCLOG().
bool ForceTransactionIdLimitUpdate | ( | void | ) |
Definition at line 517 of file varsup.c.
References LW_SHARED, LWLockAcquire(), LWLockRelease(), TransamVariablesData::nextXid, ObjectIdGetDatum(), TransamVariablesData::oldestXid, TransamVariablesData::oldestXidDB, SearchSysCacheExists1, TransactionIdFollowsOrEquals(), TransactionIdIsNormal, TransactionIdIsValid, TransamVariables, XidFromFullTransactionId, and TransamVariablesData::xidVacLimit.
Referenced by vac_update_datfrozenxid().
|
inlinestatic |
Definition at line 128 of file transam.h.
References generate_unaccent_rules::dest, FirstNormalFullTransactionId, FirstNormalTransactionId, FullTransactionIdPrecedes, and XidFromFullTransactionId.
Referenced by GetNewTransactionId(), and GetSnapshotData().
|
inlinestatic |
Definition at line 71 of file transam.h.
References epoch, and FullTransactionId::value.
Referenced by AdjustToFullTransactionId(), AdvanceNextFullTransactionIdPastXid(), BootStrapXLOG(), FullTransactionIdFromXidAndCtx(), GetNewTransactionId(), GistPageGetDeleteXid(), GuessControlValues(), main(), TransactionIdInRecentPast(), widen_snapshot_xid(), and XLogRecGetFullXid().
|
inlinestatic |
Definition at line 81 of file transam.h.
References FullTransactionId::value, and value.
Referenced by DatumGetFullTransactionId(), FullTransactionIdFromXidAndCtx(), FullXidRelativeTo(), parse_snapshot(), pg_snapshot_recv(), restoreTwoPhaseData(), xid8in(), and xid8recv().
|
inlinestatic |
Definition at line 360 of file transam.h.
References a, b, FullTransactionIdFollows, and FullTransactionIdIsValid.
Referenced by GetSnapshotData(), and GlobalVisUpdateApply().
|
inlinestatic |
Definition at line 103 of file transam.h.
References generate_unaccent_rules::dest, FirstNormalFullTransactionId, FirstNormalTransactionId, FullTransactionIdPrecedes, and XidFromFullTransactionId.
Referenced by StartupXLOG().
Oid GetNewObjectId | ( | void | ) |
Definition at line 555 of file varsup.c.
References elog, ERROR, FirstGenbkiObjectId, FirstNormalObjectId, IsPostmasterEnvironment, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), TransamVariablesData::nextOid, TransamVariablesData::oidCount, RecoveryInProgress(), TransamVariables, VAR_OID_PREFETCH, and XLogPutNextOid().
Referenced by GetNewOidWithIndex(), and GetNewRelFileNumber().
FullTransactionId GetNewTransactionId | ( | bool | isSubXact | ) |
Definition at line 77 of file varsup.c.
References Assert, BootstrapTransactionId, XidCacheStatus::count, elog, ereport, errcode(), errhint(), errmsg(), ERROR, ExtendCLOG(), ExtendCommitTs(), ExtendSUBTRANS(), FullTransactionIdAdvance(), FullTransactionIdFromEpochAndXid(), get_database_name(), IsBootstrapProcessingMode, IsInParallelMode(), IsUnderPostmaster, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MyProc, TransamVariablesData::nextXid, TransamVariablesData::oldestXidDB, XidCacheStatus::overflowed, pg_write_barrier, PGPROC_MAX_CACHED_SUBXIDS, PGPROC::pgxactoff, PMSIGNAL_START_AUTOVAC_LAUNCHER, ProcGlobal, RecoveryInProgress(), SendPostmasterSignal(), PGPROC::subxids, PROC_HDR::subxidStates, PGPROC::subxidStatus, TransactionIdFollowsOrEquals(), TransamVariables, WARNING, PGPROC::xid, XidFromFullTransactionId, XidCache::xids, PROC_HDR::xids, TransamVariablesData::xidStopLimit, TransamVariablesData::xidVacLimit, TransamVariablesData::xidWarnLimit, and TransamVariablesData::xidWrapLimit.
Referenced by AssignTransactionId(), and consume_xids_common().
|
inlinestatic |
Definition at line 349 of file transam.h.
References a, Assert, b, NormalTransactionIdPrecedes, and TransactionIdIsNormal.
FullTransactionId ReadNextFullTransactionId | ( | void | ) |
Definition at line 288 of file varsup.c.
References LW_SHARED, LWLockAcquire(), LWLockRelease(), TransamVariablesData::nextXid, and TransamVariables.
Referenced by _bt_unlink_halfdead_page(), consume_xids(), consume_xids_common(), gistdeletepage(), pg_current_snapshot(), ReadNextTransactionId(), ResolveRecoveryConflictWithSnapshotFullXid(), TransactionIdInRecentPast(), and XLogWalRcvSendHSFeedback().
|
inlinestatic |
Definition at line 315 of file transam.h.
References ReadNextFullTransactionId(), and XidFromFullTransactionId.
Referenced by ActivateCommitTs(), AutoVacWorkerMain(), do_start_worker(), GetStableLatestTransactionId(), ginDeletePage(), heap_vacuum_rel(), vac_truncate_clog(), vac_update_datfrozenxid(), vac_update_relstats(), vacuum_get_cutoffs(), and vacuum_xid_failsafe_check().
void SetTransactionIdLimit | ( | TransactionId | oldest_datfrozenxid, |
Oid | oldest_datoid | ||
) |
Definition at line 372 of file varsup.c.
References Assert, autovacuum_freeze_max_age, DEBUG1, ereport, errhint(), errmsg(), errmsg_internal(), FirstNormalTransactionId, get_database_name(), InRecovery, IsTransactionState(), IsUnderPostmaster, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MaxTransactionId, TransamVariablesData::nextXid, TransamVariablesData::oldestXid, TransamVariablesData::oldestXidDB, PMSIGNAL_START_AUTOVAC_LAUNCHER, SendPostmasterSignal(), TransactionIdFollowsOrEquals(), TransactionIdIsNormal, TransamVariables, WARNING, XidFromFullTransactionId, TransamVariablesData::xidStopLimit, TransamVariablesData::xidVacLimit, TransamVariablesData::xidWarnLimit, and TransamVariablesData::xidWrapLimit.
Referenced by BootStrapXLOG(), StartupXLOG(), vac_truncate_clog(), and xlog_redo().
void StopGeneratingPinnedObjectIds | ( | void | ) |
Definition at line 652 of file varsup.c.
References FirstUnpinnedObjectId, and SetNextObjectId().
Referenced by pg_stop_making_pinned_objects().
void TransactionIdAbortTree | ( | TransactionId | xid, |
int | nxids, | ||
TransactionId * | xids | ||
) |
Definition at line 270 of file transam.c.
References InvalidXLogRecPtr, TRANSACTION_STATUS_ABORTED, and TransactionIdSetTreeStatus().
Referenced by RecordTransactionAbort(), RecordTransactionAbortPrepared(), and xact_redo_abort().
void TransactionIdAsyncCommitTree | ( | TransactionId | xid, |
int | nxids, | ||
TransactionId * | xids, | ||
XLogRecPtr | lsn | ||
) |
Definition at line 252 of file transam.c.
References TRANSACTION_STATUS_COMMITTED, and TransactionIdSetTreeStatus().
Referenced by RecordTransactionCommit(), and xact_redo_commit().
void TransactionIdCommitTree | ( | TransactionId | xid, |
int | nxids, | ||
TransactionId * | xids | ||
) |
Definition at line 240 of file transam.c.
References InvalidXLogRecPtr, TRANSACTION_STATUS_COMMITTED, and TransactionIdSetTreeStatus().
Referenced by RecordTransactionCommit(), RecordTransactionCommitPrepared(), and xact_redo_commit().
bool TransactionIdDidAbort | ( | TransactionId | transactionId | ) |
Definition at line 188 of file transam.c.
References elog, SubTransGetParent(), TRANSACTION_STATUS_ABORTED, TRANSACTION_STATUS_SUB_COMMITTED, TransactionIdIsValid, TransactionIdPrecedes(), TransactionLogFetch(), TransactionXmin, and WARNING.
Referenced by DoesMultiXactIdConflict(), heap_lock_updated_tuple_rec(), heap_update(), ProcArrayApplyRecoveryInfo(), ProcessTwoPhaseBuffer(), StandbyAcquireAccessExclusiveLock(), test_lockmode_for_conflict(), and TransactionIdIsInProgress().
bool TransactionIdDidCommit | ( | TransactionId | transactionId | ) |
Definition at line 126 of file transam.c.
References elog, SubTransGetParent(), TRANSACTION_STATUS_COMMITTED, TRANSACTION_STATUS_SUB_COMMITTED, TransactionIdIsValid, TransactionIdPrecedes(), TransactionLogFetch(), TransactionXmin, and WARNING.
Referenced by asyncQueueProcessPageEntries(), check_safe_enum_use(), compute_new_xmax_infomask(), FreezeMultiXactId(), HandleConcurrentAbort(), heap_pre_freeze_checks(), HeapTupleHeaderAdvanceConflictHorizon(), HeapTupleHeaderIsOnlyLocked(), HeapTupleSatisfiesDirty(), HeapTupleSatisfiesHistoricMVCC(), HeapTupleSatisfiesMVCC(), HeapTupleSatisfiesSelf(), HeapTupleSatisfiesToast(), HeapTupleSatisfiesUpdate(), HeapTupleSatisfiesVacuumHorizon(), MultiXactIdExpand(), pg_xact_status(), ProcArrayApplyRecoveryInfo(), ProcessTwoPhaseBuffer(), RecordTransactionAbort(), RecordTransactionAbortPrepared(), SetupCheckXidLive(), StandbyAcquireAccessExclusiveLock(), test_lockmode_for_conflict(), UpdateLogicalMappings(), and UpdateXmaxHintBits().
bool TransactionIdFollows | ( | TransactionId | id1, |
TransactionId | id2 | ||
) |
Definition at line 314 of file transam.c.
References TransactionIdIsNormal.
Referenced by find_inheritance_children_extended(), GetConflictingVirtualXIDs(), GetSerializableTransactionSnapshotInt(), heap_page_is_all_visible(), heap_page_prune_and_freeze(), heap_prune_record_unchanged_lp_normal(), HeapTupleHeaderAdvanceConflictHorizon(), predicatelock_twophase_recover(), ProcessTwoPhaseBuffer(), RecordKnownAssignedTransactionIds(), SerialAdd(), SerialGetMinConflictCommitSeqNo(), SerialSetActiveSerXmin(), SnapBuildInitialSnapshot(), SnapBuildWaitSnapshot(), SubTransSetParent(), update_local_synced_slot(), and xmin_cmp().
bool TransactionIdFollowsOrEquals | ( | TransactionId | id1, |
TransactionId | id2 | ||
) |
Definition at line 329 of file transam.c.
References TransactionIdIsNormal.
Referenced by AdvanceNextFullTransactionIdPastXid(), ForceTransactionIdLimitUpdate(), GetNewTransactionId(), HeapCheckForSerializableConflictOut(), HeapTupleSatisfiesHistoricMVCC(), KnownAssignedXidsAdd(), KnownAssignedXidsGetAndSetXmin(), KnownAssignedXidsRemovePreceding(), ProcessTwoPhaseBuffer(), SetTransactionIdLimit(), SnapBuildCommitTxn(), SnapBuildPurgeOlderTxn(), SubTransGetParent(), SubTransGetTopmostTransaction(), vacuumLeafPage(), XidInMVCCSnapshot(), and XidIsConcurrent().
XLogRecPtr TransactionIdGetCommitLSN | ( | TransactionId | xid | ) |
Definition at line 382 of file transam.c.
References cachedCommitLSN, cachedFetchXid, InvalidXLogRecPtr, TransactionIdEquals, TransactionIdGetStatus(), and TransactionIdIsNormal.
Referenced by SetHintBits().
TransactionId TransactionIdLatest | ( | TransactionId | mainxid, |
int | nxids, | ||
const TransactionId * | xids | ||
) |
Definition at line 345 of file transam.c.
References TransactionIdPrecedes().
Referenced by FinishPreparedTransaction(), ProcArrayApplyXidAssignment(), RecordTransactionAbort(), RecordTransactionCommit(), xact_redo_abort(), and xact_redo_commit().
|
inlinestatic |
Definition at line 334 of file transam.h.
References a, b, TransactionIdIsValid, and TransactionIdPrecedes().
Referenced by ComputeXidHorizons(), and GetSnapshotData().
bool TransactionIdPrecedes | ( | TransactionId | id1, |
TransactionId | id2 | ||
) |
Definition at line 280 of file transam.c.
References TransactionIdIsNormal.
Referenced by AdvanceOldestClogXid(), AdvanceOldestCommitTsXid(), bt_check_every_level(), check_exclusion_or_unique_constraint(), check_tuple_visibility(), CheckTargetForConflictsIn(), CLOGPagePrecedes(), collect_corrupt_items(), CommitTsPagePrecedes(), copy_table_data(), do_start_worker(), ExpireOldKnownAssignedTransactionIds(), ExportSnapshot(), FreezeMultiXactId(), get_relation_info(), GetOldestActiveTransactionId(), GetOldestSafeDecodingTransactionId(), GetRunningTransactionData(), heap_abort_speculative(), heap_page_is_all_visible(), heap_prepare_freeze_tuple(), heap_prune_record_prunable(), heap_prune_record_unchanged_lp_normal(), heap_tuple_should_freeze(), HeapCheckForSerializableConflictOut(), HeapTupleHeaderAdvanceConflictHorizon(), HeapTupleSatisfiesHistoricMVCC(), HeapTupleSatisfiesVacuum(), KnownAssignedXidsAdd(), KnownAssignedXidsGetAndSetXmin(), KnownAssignedXidsSearch(), logical_rewrite_heap_tuple(), MaintainLatestCompletedXid(), MaintainLatestCompletedXidRecovery(), multixact_redo(), PhysicalReplicationSlotNewXmin(), PrescanPreparedTransactions(), ProcArrayApplyRecoveryInfo(), ProcArrayApplyXidAssignment(), ProcessStandbyHSFeedbackMessage(), RecordKnownAssignedTransactionIds(), relation_needs_vacanalyze(), ReorderBufferAbortOld(), ReplicationSlotsComputeRequiredXmin(), rewrite_heap_tuple(), SerialAdd(), SerialGetMinConflictCommitSeqNo(), SerialPagePrecedesLogically(), SerialSetActiveSerXmin(), SetCommitTsLimit(), SetNewSxactGlobalXmin(), SnapBuildCommitTxn(), SnapBuildProcessChange(), SnapBuildRestore(), SnapshotResetXmin(), StandbyReleaseOldLocks(), SubTransGetTopmostTransaction(), SubTransPagePrecedes(), TransactionIdDidAbort(), TransactionIdDidCommit(), TransactionIdGetCommitTsData(), TransactionIdIsActive(), TransactionIdIsCurrentTransactionId(), TransactionIdIsInProgress(), TransactionIdLatest(), TransactionIdOlder(), TransactionTreeSetCommitTsData(), tuple_all_visible(), update_local_synced_slot(), vac_truncate_clog(), vac_update_datfrozenxid(), vac_update_relstats(), vacuum_get_cutoffs(), vacuum_xid_failsafe_check(), vacuumRedirectAndPlaceholder(), XidInMVCCSnapshot(), XidIsConcurrent(), xidLogicalComparator(), xlog_redo(), and xmin_cmp().
bool TransactionIdPrecedesOrEquals | ( | TransactionId | id1, |
TransactionId | id2 | ||
) |
Definition at line 299 of file transam.c.
References TransactionIdIsNormal.
Referenced by ClearOldPredicateLocks(), ComputeXidHorizons(), GetCurrentVirtualXIDs(), GetSnapshotData(), GetSnapshotDataReuse(), heap_prepare_freeze_tuple(), heap_tuple_should_freeze(), heap_vacuum_rel(), InvalidatePossiblyObsoleteSlot(), KnownAssignedXidsAdd(), LogicalIncreaseXminForSlot(), ProcArrayInstallImportedXmin(), ProcArrayInstallRestoredXmin(), SnapBuildFindSnapshot(), TransactionIdInRecentPast(), TransactionIdIsInProgress(), and vacuum_get_cutoffs().
|
inlinestatic |
bool TransactionStartedDuringRecovery | ( | void | ) |
Definition at line 1041 of file xact.c.
References CurrentTransactionState, and TransactionStateData::startedInRecovery.
Referenced by RelationGetIndexScan().
void VarsupShmemInit | ( | void | ) |
Definition at line 47 of file varsup.c.
References Assert, IsUnderPostmaster, ShmemInitStruct(), and TransamVariables.
Referenced by CreateOrAttachShmemStructs().
Size VarsupShmemSize | ( | void | ) |
Definition at line 41 of file varsup.c.
Referenced by CalculateShmemSize().
|
extern |
Definition at line 34 of file varsup.c.
Referenced by ActivateCommitTs(), AdjustToFullTransactionId(), AdvanceNextFullTransactionIdPastXid(), AdvanceOldestClogXid(), AdvanceOldestCommitTsXid(), BootStrapXLOG(), ComputeXidHorizons(), consume_xids_shortcut(), CreateCheckPoint(), DeactivateCommitTs(), ExpireTreeKnownAssignedTransactionIds(), ForceTransactionIdLimitUpdate(), GetNewObjectId(), GetNewTransactionId(), GetOldestActiveTransactionId(), GetOldestSafeDecodingTransactionId(), GetRunningTransactionData(), GetSnapshotData(), GetSnapshotDataReuse(), GetStrictOldestNonRemovableTransactionId(), MaintainLatestCompletedXid(), MaintainLatestCompletedXidRecovery(), PrescanPreparedTransactions(), ProcArrayApplyRecoveryInfo(), ProcArrayClearTransaction(), ProcArrayEndTransactionInternal(), ProcArrayRemove(), ProcArrayShmemInit(), ProcessTwoPhaseBuffer(), ReadNextFullTransactionId(), ReleasePredicateLocks(), SetCommitTsLimit(), SetNextObjectId(), SetTransactionIdLimit(), StartupCLOG(), StartupSUBTRANS(), StartupXLOG(), TransactionIdGetCommitTsData(), TransactionIdInRecentPast(), TransactionIdIsInProgress(), TransactionTreeSetCommitTsData(), TrimCLOG(), update_cached_xid_range(), VarsupShmemInit(), XidCacheRemoveRunningXids(), xlog_redo(), and XLogRecGetFullXid().