PostgreSQL Source Code
git master
|
#include "storage/lock.h"
#include "storage/standby.h"
#include "utils/relcache.h"
#include "utils/snapshot.h"
Go to the source code of this file.
PGPROC* BackendPidGetProc | ( | int | pid | ) |
Definition at line 3036 of file procarray.c.
References BackendPidGetProcWithLock(), LW_SHARED, LWLockAcquire(), and LWLockRelease().
Referenced by IsBackendPid(), pg_signal_backend(), pg_stat_get_activity(), pg_stat_get_backend_wait_event(), pg_stat_get_backend_wait_event_type(), ProcSendSignal(), TerminateOtherDBBackends(), and test_shm_mq_main().
PGPROC* BackendPidGetProcWithLock | ( | int | pid | ) |
Definition at line 3059 of file procarray.c.
References ProcArrayStruct::numProcs, ProcArrayStruct::pgprocnos, PGPROC::pid, and procArray.
Referenced by BackendPidGetProc(), and GetBlockerStatusData().
int BackendXidGetPid | ( | TransactionId | xid | ) |
Definition at line 3096 of file procarray.c.
References InvalidTransactionId, LW_SHARED, LWLockAcquire(), LWLockRelease(), ProcArrayStruct::numProcs, ProcArrayStruct::pgprocnos, PGPROC::pid, procArray, ProcGlobal, and PROC_HDR::xids.
Referenced by pgrowlocks().
void CancelDBBackends | ( | Oid | databaseid, |
ProcSignalReason | sigmode, | ||
bool | conflictPending | ||
) |
Definition at line 3495 of file procarray.c.
References VirtualTransactionId::backendId, PGPROC::databaseId, GET_VXID_FROM_PGPROC, InvalidOid, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), ProcArrayStruct::numProcs, ProcArrayStruct::pgprocnos, PGPROC::pid, procArray, PGPROC::recoveryConflictPending, and SendProcSignal().
Referenced by ResolveRecoveryConflictWithDatabase(), and SendRecoveryConflictWithBufferPin().
pid_t CancelVirtualTransaction | ( | VirtualTransactionId | vxid, |
ProcSignalReason | sigmode | ||
) |
Definition at line 3326 of file procarray.c.
References SignalVirtualTransaction().
Referenced by ResolveRecoveryConflictWithVirtualXIDs().
int CountDBBackends | ( | Oid | databaseid | ) |
Definition at line 3434 of file procarray.c.
References PGPROC::databaseId, LW_SHARED, LWLockAcquire(), LWLockRelease(), ProcArrayStruct::numProcs, OidIsValid, ProcArrayStruct::pgprocnos, PGPROC::pid, and procArray.
Referenced by ResolveRecoveryConflictWithDatabase().
int CountDBConnections | ( | Oid | databaseid | ) |
Definition at line 3464 of file procarray.c.
References PGPROC::databaseId, PGPROC::isBackgroundWorker, LW_SHARED, LWLockAcquire(), LWLockRelease(), ProcArrayStruct::numProcs, OidIsValid, ProcArrayStruct::pgprocnos, PGPROC::pid, and procArray.
Referenced by CheckMyDatabase().
Definition at line 3585 of file procarray.c.
References CHECK_FOR_INTERRUPTS, PGPROC::databaseId, kill, LW_SHARED, LWLockAcquire(), LWLockRelease(), MAXAUTOVACPIDS, MyProc, ProcArrayStruct::numProcs, pg_usleep(), ProcArrayStruct::pgprocnos, PGPROC::pid, PROC_IS_AUTOVACUUM, procArray, ProcGlobal, and PROC_HDR::statusFlags.
Referenced by createdb(), dropdb(), movedb(), and RenameDatabase().
int CountUserBackends | ( | Oid | roleid | ) |
Definition at line 3535 of file procarray.c.
References PGPROC::isBackgroundWorker, LW_SHARED, LWLockAcquire(), LWLockRelease(), ProcArrayStruct::numProcs, ProcArrayStruct::pgprocnos, PGPROC::pid, procArray, and PGPROC::roleId.
Referenced by InitializeSessionUserId().
void CreateSharedProcArray | ( | void | ) |
Definition at line 394 of file procarray.c.
References add_size(), PROC_HDR::allProcs, EnableHotStandby, ProcArrayStruct::headKnownAssignedXids, InvalidTransactionId, ProcArrayStruct::known_assigned_xids_lck, KnownAssignedXids, KnownAssignedXidsValid, ProcArrayStruct::lastOverflowedXid, ProcArrayStruct::maxKnownAssignedXids, ProcArrayStruct::maxProcs, mul_size(), ProcArrayStruct::numKnownAssignedXids, ProcArrayStruct::numProcs, offsetof, ProcArrayStruct::pgprocnos, PROCARRAY_MAXPROCS, ProcGlobal, ProcArrayStruct::replication_slot_catalog_xmin, ProcArrayStruct::replication_slot_xmin, ShmemInitStruct(), ShmemVariableCache, SpinLockInit, ProcArrayStruct::tailKnownAssignedXids, TOTAL_MAX_CACHED_SUBXIDS, and VariableCacheData::xactCompletionCount.
Referenced by CreateSharedMemoryAndSemaphores().
void ExpireAllKnownAssignedTransactionIds | ( | void | ) |
Definition at line 4363 of file procarray.c.
References InvalidTransactionId, KnownAssignedXidsRemovePreceding(), LW_EXCLUSIVE, LWLockAcquire(), and LWLockRelease().
Referenced by ShutdownRecoveryTransactionEnvironment().
void ExpireOldKnownAssignedTransactionIds | ( | TransactionId | xid | ) |
Definition at line 4375 of file procarray.c.
References KnownAssignedXidsRemovePreceding(), LW_EXCLUSIVE, LWLockAcquire(), and LWLockRelease().
Referenced by ProcArrayApplyRecoveryInfo().
void ExpireTreeKnownAssignedTransactionIds | ( | TransactionId | xid, |
int | nsubxids, | ||
TransactionId * | subxids, | ||
TransactionId | max_xid | ||
) |
Definition at line 4337 of file procarray.c.
References Assert, KnownAssignedXidsRemoveTree(), LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MaintainLatestCompletedXidRecovery(), ShmemVariableCache, STANDBY_INITIALIZED, standbyState, and VariableCacheData::xactCompletionCount.
Referenced by xact_redo_abort(), and xact_redo_commit().
VirtualTransactionId* GetConflictingVirtualXIDs | ( | TransactionId | limitXmin, |
Oid | dbOid | ||
) |
Definition at line 3252 of file procarray.c.
References VirtualTransactionId::backendId, PGPROC::databaseId, ereport, errcode(), errmsg(), ERROR, GET_VXID_FROM_PGPROC, InvalidBackendId, InvalidLocalTransactionId, VirtualTransactionId::localTransactionId, LW_SHARED, LWLockAcquire(), LWLockRelease(), malloc, ProcArrayStruct::maxProcs, ProcArrayStruct::numProcs, OidIsValid, ProcArrayStruct::pgprocnos, PGPROC::pid, procArray, TransactionIdFollows(), TransactionIdIsValid, UINT32_ACCESS_ONCE, VirtualTransactionIdIsValid, and PGPROC::xmin.
Referenced by ResolveRecoveryConflictWithSnapshot(), and ResolveRecoveryConflictWithTablespace().
VirtualTransactionId* GetCurrentVirtualXIDs | ( | TransactionId | limitXmin, |
bool | excludeXmin0, | ||
bool | allDbs, | ||
int | excludeVacuum, | ||
int * | nvxids | ||
) |
Definition at line 3164 of file procarray.c.
References PGPROC::databaseId, GET_VXID_FROM_PGPROC, LW_SHARED, LWLockAcquire(), LWLockRelease(), ProcArrayStruct::maxProcs, MyDatabaseId, MyProc, ProcArrayStruct::numProcs, palloc(), ProcArrayStruct::pgprocnos, procArray, ProcGlobal, PROC_HDR::statusFlags, TransactionIdIsValid, TransactionIdPrecedesOrEquals(), UINT32_ACCESS_ONCE, VirtualTransactionIdIsValid, and PGPROC::xmin.
Referenced by WaitForOlderSnapshots().
int GetMaxSnapshotSubxidCount | ( | void | ) |
Definition at line 1983 of file procarray.c.
References TOTAL_MAX_CACHED_SUBXIDS.
Referenced by ExportSnapshot(), GetSnapshotData(), ImportSnapshot(), and SetTransactionSnapshot().
int GetMaxSnapshotXidCount | ( | void | ) |
Definition at line 1972 of file procarray.c.
References ProcArrayStruct::maxProcs.
Referenced by GetSnapshotData(), ImportSnapshot(), SetTransactionSnapshot(), and SnapBuildInitialSnapshot().
TransactionId GetOldestActiveTransactionId | ( | void | ) |
Definition at line 2785 of file procarray.c.
References Assert, LW_SHARED, LWLockAcquire(), LWLockRelease(), VariableCacheData::nextXid, ProcArrayStruct::numProcs, procArray, ProcGlobal, RecoveryInProgress(), ShmemVariableCache, TransactionIdIsNormal, TransactionIdPrecedes(), UINT32_ACCESS_ONCE, XidFromFullTransactionId, and PROC_HDR::xids.
Referenced by CreateCheckPoint().
TransactionId GetOldestNonRemovableTransactionId | ( | Relation | rel | ) |
Definition at line 1913 of file procarray.c.
References ComputeXidHorizonsResult::catalog_oldest_nonremovable, ComputeXidHorizons(), ComputeXidHorizonsResult::data_oldest_nonremovable, RelationData::rd_rel, RELATION_IS_LOCAL, RelationIsAccessibleInLogicalDecoding, ComputeXidHorizonsResult::shared_oldest_nonremovable, and ComputeXidHorizonsResult::temp_oldest_nonremovable.
Referenced by acquire_sample_rows(), collect_corrupt_items(), heapam_index_build_range_scan(), statapprox_heap(), vac_update_datfrozenxid(), and vacuum_set_xid_limits().
TransactionId GetOldestSafeDecodingTransactionId | ( | bool | catalogOnly | ) |
Definition at line 2850 of file procarray.c.
References Assert, LW_SHARED, LWLockAcquire(), LWLockHeldByMe(), LWLockRelease(), VariableCacheData::nextXid, ProcArrayStruct::numProcs, procArray, ProcGlobal, RecoveryInProgress(), ProcArrayStruct::replication_slot_catalog_xmin, ProcArrayStruct::replication_slot_xmin, ShmemVariableCache, TransactionIdIsNormal, TransactionIdIsValid, TransactionIdPrecedes(), UINT32_ACCESS_ONCE, XidFromFullTransactionId, and PROC_HDR::xids.
Referenced by CreateInitDecodingContext(), and SnapBuildInitialSnapshot().
TransactionId GetOldestTransactionIdConsideredRunning | ( | void | ) |
Definition at line 1937 of file procarray.c.
References ComputeXidHorizons(), and ComputeXidHorizonsResult::oldest_considered_running.
Referenced by CreateCheckPoint(), and CreateRestartPoint().
void GetReplicationHorizons | ( | TransactionId * | slot_xmin, |
TransactionId * | catalog_xmin | ||
) |
Definition at line 1950 of file procarray.c.
References ComputeXidHorizons(), ComputeXidHorizonsResult::shared_oldest_nonremovable_raw, and ComputeXidHorizonsResult::slot_catalog_xmin.
Referenced by XLogWalRcvSendHSFeedback().
RunningTransactions GetRunningTransactionData | ( | void | ) |
Definition at line 2610 of file procarray.c.
References Assert, XidCacheStatus::count, ereport, errcode(), errmsg(), ERROR, RunningTransactionsData::latestCompletedXid, VariableCacheData::latestCompletedXid, LW_SHARED, LWLockAcquire(), malloc, RunningTransactionsData::nextXid, VariableCacheData::nextXid, ProcArrayStruct::numProcs, RunningTransactionsData::oldestRunningXid, XidCacheStatus::overflowed, pg_read_barrier, ProcArrayStruct::pgprocnos, procArray, ProcGlobal, RecoveryInProgress(), ShmemVariableCache, RunningTransactionsData::subxcnt, RunningTransactionsData::subxid_overflow, PGPROC::subxids, PROC_HDR::subxidStates, TOTAL_MAX_CACHED_SUBXIDS, TransactionIdIsNormal, TransactionIdIsValid, TransactionIdPrecedes(), UINT32_ACCESS_ONCE, RunningTransactionsData::xcnt, XidFromFullTransactionId, XidCache::xids, RunningTransactionsData::xids, and PROC_HDR::xids.
Referenced by LogStandbySnapshot().
Definition at line 2109 of file procarray.c.
References SnapshotData::active_count, Assert, SnapshotData::copied, XidCacheStatus::count, SnapshotData::curcid, GlobalVisState::definitely_needed, ereport, errcode(), errmsg(), ERROR, FullTransactionIdAdvance(), FullTransactionIdNewer(), FullXidRelativeTo(), GetCurrentCommandId(), GetMaxSnapshotSubxidCount(), GetMaxSnapshotXidCount(), GetSnapshotDataInitOldSnapshot(), GetSnapshotDataReuse(), InvalidTransactionId, KnownAssignedXidsGetAndSetXmin(), ProcArrayStruct::lastOverflowedXid, VariableCacheData::latestCompletedXid, likely, LW_SHARED, LWLockAcquire(), LWLockRelease(), malloc, GlobalVisState::maybe_needed, MyProc, NormalTransactionIdPrecedes, ProcArrayStruct::numProcs, VariableCacheData::oldestXid, pg_read_barrier, ProcArrayStruct::pgprocnos, PGPROC::pgxactoff, PROC_IN_LOGICAL_DECODING, PROC_IN_VACUUM, procArray, ProcGlobal, RecentXmin, RecoveryInProgress(), SnapshotData::regd_count, ProcArrayStruct::replication_slot_catalog_xmin, ProcArrayStruct::replication_slot_xmin, ShmemVariableCache, SnapshotData::snapXactCompletionCount, PROC_HDR::statusFlags, SnapshotData::suboverflowed, SnapshotData::subxcnt, PGPROC::subxids, PROC_HDR::subxidStates, SnapshotData::subxip, SnapshotData::takenDuringRecovery, TransactionIdAdvance, TransactionIdIsNormal, TransactionIdIsValid, TransactionIdOlder(), TransactionIdPrecedesOrEquals(), TransactionIdRetreatedBy(), TransactionXmin, UINT32_ACCESS_ONCE, vacuum_defer_cleanup_age, VariableCacheData::xactCompletionCount, SnapshotData::xcnt, PGPROC::xid, XidFromFullTransactionId, XidCache::xids, PROC_HDR::xids, SnapshotData::xip, SnapshotData::xmax, PGPROC::xmin, and SnapshotData::xmin.
Referenced by GetLatestSnapshot(), GetNonHistoricCatalogSnapshot(), GetSerializableTransactionSnapshotInt(), GetTransactionSnapshot(), and SetTransactionSnapshot().
VirtualTransactionId* GetVirtualXIDsDelayingChkpt | ( | int * | nvxids | ) |
Definition at line 2946 of file procarray.c.
References PGPROC::delayChkpt, GET_VXID_FROM_PGPROC, LW_SHARED, LWLockAcquire(), LWLockRelease(), ProcArrayStruct::maxProcs, ProcArrayStruct::numProcs, palloc(), ProcArrayStruct::pgprocnos, procArray, and VirtualTransactionIdIsValid.
Referenced by CreateCheckPoint().
bool HaveVirtualXIDsDelayingChkpt | ( | VirtualTransactionId * | vxids, |
int | nvxids | ||
) |
Definition at line 2990 of file procarray.c.
References PGPROC::delayChkpt, GET_VXID_FROM_PGPROC, i, LW_SHARED, LWLockAcquire(), LWLockRelease(), ProcArrayStruct::numProcs, ProcArrayStruct::pgprocnos, procArray, VirtualTransactionIdEquals, and VirtualTransactionIdIsValid.
Referenced by CreateCheckPoint().
bool IsBackendPid | ( | int | pid | ) |
Definition at line 3131 of file procarray.c.
References BackendPidGetProc().
Referenced by pg_stat_get_subscription().
bool MinimumActiveBackends | ( | int | min | ) |
Definition at line 3381 of file procarray.c.
References InvalidTransactionId, MyProc, ProcArrayStruct::numProcs, ProcArrayStruct::pgprocnos, PGPROC::pid, procArray, PGPROC::waitLock, and PGPROC::xid.
Referenced by XLogFlush().
void ProcArrayAdd | ( | PGPROC * | proc | ) |
Definition at line 445 of file procarray.c.
References ereport, errcode(), errmsg(), FATAL, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), ProcArrayStruct::maxProcs, ProcArrayStruct::numProcs, PGPROC::pgprocno, ProcArrayStruct::pgprocnos, PGPROC::pgxactoff, procArray, ProcGlobal, PGPROC::statusFlags, PROC_HDR::statusFlags, PROC_HDR::subxidStates, PGPROC::subxidStatus, PGPROC::xid, and PROC_HDR::xids.
Referenced by InitProcessPhase2(), and MarkAsPrepared().
void ProcArrayApplyRecoveryInfo | ( | RunningTransactions | running | ) |
Definition at line 1000 of file procarray.c.
References AdvanceNextFullTransactionIdPastXid(), Assert, DEBUG1, DEBUG3, elog, ERROR, ExpireOldKnownAssignedTransactionIds(), ExtendSUBTRANS(), FullTransactionIdIsValid, i, InvalidTransactionId, KnownAssignedXidsAdd(), KnownAssignedXidsDisplay(), KnownAssignedXidsReset(), ProcArrayStruct::lastOverflowedXid, RunningTransactionsData::latestCompletedXid, latestObservedXid, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MaintainLatestCompletedXidRecovery(), RunningTransactionsData::nextXid, VariableCacheData::nextXid, ProcArrayStruct::numKnownAssignedXids, RunningTransactionsData::oldestRunningXid, palloc(), pfree(), qsort, ShmemVariableCache, STANDBY_INITIALIZED, STANDBY_SNAPSHOT_PENDING, STANDBY_SNAPSHOT_READY, StandbyReleaseOldLocks(), standbySnapshotPendingXmin, standbyState, RunningTransactionsData::subxcnt, RunningTransactionsData::subxid_overflow, trace_recovery(), TransactionIdAdvance, TransactionIdDidAbort(), TransactionIdDidCommit(), TransactionIdEquals, TransactionIdIsNormal, TransactionIdIsValid, TransactionIdPrecedes(), TransactionIdRetreat, RunningTransactionsData::xcnt, xidComparator(), and RunningTransactionsData::xids.
Referenced by standby_redo(), StartupXLOG(), and xlog_redo().
void ProcArrayApplyXidAssignment | ( | TransactionId | topxid, |
int | nsubxids, | ||
TransactionId * | subxids | ||
) |
Definition at line 1236 of file procarray.c.
References Assert, i, InvalidTransactionId, KnownAssignedXidsRemoveTree(), ProcArrayStruct::lastOverflowedXid, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), RecordKnownAssignedTransactionIds(), STANDBY_INITIALIZED, standbyState, SubTransSetParent(), TransactionIdLatest(), and TransactionIdPrecedes().
Referenced by xact_redo().
void ProcArrayClearTransaction | ( | PGPROC * | proc | ) |
Definition at line 853 of file procarray.c.
References Assert, XidCacheStatus::count, PGPROC::delayChkpt, InvalidLocalTransactionId, InvalidTransactionId, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), PGPROC::lxid, XidCacheStatus::overflowed, PGPROC::pgxactoff, PROC_VACUUM_STATE_MASK, ProcGlobal, PGPROC::recoveryConflictPending, ShmemVariableCache, PGPROC::statusFlags, PROC_HDR::subxidStates, PGPROC::subxidStatus, VariableCacheData::xactCompletionCount, PGPROC::xid, PROC_HDR::xids, and PGPROC::xmin.
Referenced by PrepareTransaction().
void ProcArrayEndTransaction | ( | PGPROC * | proc, |
TransactionId | latestXid | ||
) |
Definition at line 620 of file procarray.c.
References Assert, XidCacheStatus::count, PGPROC::delayChkpt, InvalidLocalTransactionId, InvalidTransactionId, LW_EXCLUSIVE, LWLockAcquire(), LWLockConditionalAcquire(), LWLockHeldByMe(), LWLockRelease(), PGPROC::lxid, XidCacheStatus::overflowed, PGPROC::pgxactoff, PROC_VACUUM_STATE_MASK, ProcArrayEndTransactionInternal(), ProcArrayGroupClearXid(), ProcGlobal, PGPROC::recoveryConflictPending, PGPROC::statusFlags, PROC_HDR::statusFlags, PGPROC::subxidStatus, TransactionIdIsValid, PGPROC::xid, and PGPROC::xmin.
Referenced by AbortTransaction(), and CommitTransaction().
void ProcArrayGetReplicationSlotXmin | ( | TransactionId * | xmin, |
TransactionId * | catalog_xmin | ||
) |
Definition at line 3793 of file procarray.c.
References LW_SHARED, LWLockAcquire(), LWLockRelease(), ProcArrayStruct::replication_slot_catalog_xmin, and ProcArrayStruct::replication_slot_xmin.
Referenced by logical_begin_heap_rewrite().
void ProcArrayInitRecovery | ( | TransactionId | initializedUptoXID | ) |
Definition at line 969 of file procarray.c.
References Assert, latestObservedXid, STANDBY_INITIALIZED, standbyState, TransactionIdIsNormal, and TransactionIdRetreat.
Referenced by StartupXLOG().
bool ProcArrayInstallImportedXmin | ( | TransactionId | xmin, |
VirtualTransactionId * | sourcevxid | ||
) |
Definition at line 2472 of file procarray.c.
References Assert, VirtualTransactionId::backendId, PGPROC::backendId, PGPROC::databaseId, VirtualTransactionId::localTransactionId, LW_SHARED, LWLockAcquire(), LWLockRelease(), PGPROC::lxid, MyDatabaseId, MyProc, ProcArrayStruct::numProcs, ProcArrayStruct::pgprocnos, PROC_IN_VACUUM, procArray, ProcGlobal, PROC_HDR::statusFlags, TransactionIdIsNormal, TransactionIdPrecedesOrEquals(), TransactionXmin, UINT32_ACCESS_ONCE, and PGPROC::xmin.
Referenced by GetSerializableTransactionSnapshotInt(), and SetTransactionSnapshot().
bool ProcArrayInstallRestoredXmin | ( | TransactionId | xmin, |
PGPROC * | proc | ||
) |
Definition at line 2547 of file procarray.c.
References Assert, PGPROC::databaseId, LW_SHARED, LWLockAcquire(), LWLockRelease(), MyDatabaseId, MyProc, TransactionIdIsNormal, TransactionIdPrecedesOrEquals(), TransactionXmin, UINT32_ACCESS_ONCE, and PGPROC::xmin.
Referenced by SetTransactionSnapshot().
void ProcArrayRemove | ( | PGPROC * | proc, |
TransactionId | latestXid | ||
) |
Definition at line 525 of file procarray.c.
References PROC_HDR::allProcs, Assert, XidCacheStatus::count, elog, LOG, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MaintainLatestCompletedXid(), ProcArrayStruct::numProcs, XidCacheStatus::overflowed, PGPROC::pgprocno, ProcArrayStruct::pgprocnos, PGPROC::pgxactoff, PGPROC::pid, procArray, ProcGlobal, ShmemVariableCache, PROC_HDR::statusFlags, PROC_HDR::subxidStates, TransactionIdIsValid, VariableCacheData::xactCompletionCount, and PROC_HDR::xids.
Referenced by FinishPreparedTransaction(), and RemoveProcFromArray().
void ProcArraySetReplicationSlotXmin | ( | TransactionId | xmin, |
TransactionId | catalog_xmin, | ||
bool | already_locked | ||
) |
Definition at line 3771 of file procarray.c.
References Assert, LW_EXCLUSIVE, LWLockAcquire(), LWLockHeldByMe(), LWLockRelease(), ProcArrayStruct::replication_slot_catalog_xmin, and ProcArrayStruct::replication_slot_xmin.
Referenced by ReplicationSlotsComputeRequiredXmin().
Size ProcArrayShmemSize | ( | void | ) |
Definition at line 352 of file procarray.c.
References add_size(), EnableHotStandby, mul_size(), offsetof, ProcArrayStruct::pgprocnos, PROCARRAY_MAXPROCS, and TOTAL_MAX_CACHED_SUBXIDS.
Referenced by CreateSharedMemoryAndSemaphores().
void RecordKnownAssignedTransactionIds | ( | TransactionId | xid | ) |
Definition at line 4266 of file procarray.c.
References AdvanceNextFullTransactionIdPastXid(), Assert, DEBUG4, elog, ExtendSUBTRANS(), KnownAssignedXidsAdd(), latestObservedXid, STANDBY_INITIALIZED, standbyState, trace_recovery(), TransactionIdAdvance, TransactionIdFollows(), TransactionIdIsValid, and TransactionIdPrecedes().
Referenced by ProcArrayApplyXidAssignment(), StartupXLOG(), xact_redo_abort(), and xact_redo_commit().
pid_t SignalVirtualTransaction | ( | VirtualTransactionId | vxid, |
ProcSignalReason | sigmode, | ||
bool | conflictPending | ||
) |
Definition at line 3332 of file procarray.c.
References VirtualTransactionId::backendId, GET_VXID_FROM_PGPROC, VirtualTransactionId::localTransactionId, LW_SHARED, LWLockAcquire(), LWLockRelease(), ProcArrayStruct::numProcs, ProcArrayStruct::pgprocnos, PGPROC::pid, procArray, PGPROC::recoveryConflictPending, and SendProcSignal().
Referenced by CancelVirtualTransaction(), and ResolveRecoveryConflictWithLock().
void TerminateOtherDBBackends | ( | Oid | databaseId | ) |
Definition at line 3663 of file procarray.c.
References BackendPidGetProc(), PGPROC::databaseId, ereport, errcode(), errdetail_plural(), errmsg(), ERROR, get_database_name(), GetUserId(), has_privs_of_role(), i, kill, lappend_int(), lfirst_int, LW_SHARED, LWLockAcquire(), LWLockRelease(), MyProc, NIL, ProcArrayStruct::numProcs, ProcArrayStruct::pgprocnos, PGPROC::pid, procArray, PGPROC::roleId, superuser(), and superuser_arg().
Referenced by dropdb().
bool TransactionIdIsActive | ( | TransactionId | xid | ) |
Definition at line 1552 of file procarray.c.
References i, LW_SHARED, LWLockAcquire(), LWLockRelease(), ProcArrayStruct::numProcs, ProcArrayStruct::pgprocnos, PGPROC::pid, procArray, ProcGlobal, RecentXmin, TransactionIdEquals, TransactionIdIsValid, TransactionIdPrecedes(), UINT32_ACCESS_ONCE, and PROC_HDR::xids.
bool TransactionIdIsInProgress | ( | TransactionId | xid | ) |
Definition at line 1320 of file procarray.c.
References Assert, XidCacheStatus::count, ereport, errcode(), errmsg(), ERROR, i, KnownAssignedXidExists(), KnownAssignedXidsGet(), ProcArrayStruct::lastOverflowedXid, VariableCacheData::latestCompletedXid, LW_SHARED, LWLockAcquire(), LWLockRelease(), malloc, ProcArrayStruct::maxProcs, MyProc, ProcArrayStruct::numProcs, pg_read_barrier, ProcArrayStruct::pgprocnos, PGPROC::pgxactoff, procArray, ProcGlobal, RecentXmin, RecoveryInProgress(), ShmemVariableCache, SubTransGetTopmostTransaction(), PGPROC::subxids, PROC_HDR::subxidStates, TOTAL_MAX_CACHED_SUBXIDS, TransactionIdDidAbort(), TransactionIdEquals, TransactionIdIsCurrentTransactionId(), TransactionIdIsKnownCompleted(), TransactionIdIsValid, TransactionIdPrecedes(), TransactionIdPrecedesOrEquals(), UINT32_ACCESS_ONCE, xc_by_child_xid_inc, xc_by_known_assigned_inc, xc_by_known_xact_inc, xc_by_latest_xid_inc, xc_by_main_xid_inc, xc_by_my_xact_inc, xc_by_recent_xmin_inc, xc_no_overflow_inc, xc_slow_answer_inc, XidFromFullTransactionId, XidCache::xids, and PROC_HDR::xids.
Referenced by check_safe_enum_use(), compute_new_xmax_infomask(), ConditionalXactLockTableWait(), Do_MultiXactIdWait(), DoesMultiXactIdConflict(), FreezeMultiXactId(), HandleConcurrentAbort(), HeapTupleHeaderIsOnlyLocked(), HeapTupleSatisfiesDirty(), HeapTupleSatisfiesSelf(), HeapTupleSatisfiesToast(), HeapTupleSatisfiesUpdate(), HeapTupleSatisfiesVacuumHorizon(), MultiXactIdExpand(), MultiXactIdIsRunning(), test_lockmode_for_conflict(), and XactLockTableWait().
void XidCacheRemoveRunningXids | ( | TransactionId | xid, |
int | nxids, | ||
const TransactionId * | xids, | ||
TransactionId | latestXid | ||
) |
Definition at line 3816 of file procarray.c.
References Assert, XidCacheStatus::count, elog, fprintf, i, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MaintainLatestCompletedXid(), MyProc, pg_write_barrier, PGPROC::pgxactoff, ProcGlobal, PGPROC::subxids, PROC_HDR::subxidStates, PGPROC::subxidStatus, TransactionIdEquals, TransactionIdIsValid, WARNING, and XidCache::xids.
Referenced by RecordTransactionAbort().