PostgreSQL Source Code git master
|
#include "postgres.h"
#include <signal.h>
#include "access/subtrans.h"
#include "access/transam.h"
#include "access/twophase.h"
#include "access/xact.h"
#include "access/xlogutils.h"
#include "catalog/catalog.h"
#include "catalog/pg_authid.h"
#include "commands/dbcommands.h"
#include "miscadmin.h"
#include "pgstat.h"
#include "port/pg_lfind.h"
#include "storage/proc.h"
#include "storage/procarray.h"
#include "utils/acl.h"
#include "utils/builtins.h"
#include "utils/rel.h"
#include "utils/snapmgr.h"
Go to the source code of this file.
Data Structures | |
struct | ProcArrayStruct |
struct | GlobalVisState |
struct | ComputeXidHorizonsResult |
Macros | |
#define | UINT32_ACCESS_ONCE(var) ((uint32)(*((volatile uint32 *)&(var)))) |
#define | xc_by_recent_xmin_inc() ((void) 0) |
#define | xc_by_known_xact_inc() ((void) 0) |
#define | xc_by_my_xact_inc() ((void) 0) |
#define | xc_by_latest_xid_inc() ((void) 0) |
#define | xc_by_main_xid_inc() ((void) 0) |
#define | xc_by_child_xid_inc() ((void) 0) |
#define | xc_by_known_assigned_inc() ((void) 0) |
#define | xc_no_overflow_inc() ((void) 0) |
#define | xc_slow_answer_inc() ((void) 0) |
#define | PROCARRAY_MAXPROCS (MaxBackends + max_prepared_xacts) |
#define | TOTAL_MAX_CACHED_SUBXIDS ((PGPROC_MAX_CACHED_SUBXIDS + 1) * PROCARRAY_MAXPROCS) |
#define | MAXAUTOVACPIDS 10 /* max autovacs to SIGTERM per iteration */ |
#define | KAX_COMPRESS_FREQUENCY 128 /* in transactions */ |
#define | KAX_COMPRESS_IDLE_INTERVAL 1000 /* in ms */ |
Typedefs | |
typedef struct ProcArrayStruct | ProcArrayStruct |
typedef struct ComputeXidHorizonsResult | ComputeXidHorizonsResult |
typedef enum GlobalVisHorizonKind | GlobalVisHorizonKind |
typedef enum KAXCompressReason | KAXCompressReason |
Enumerations | |
enum | GlobalVisHorizonKind { VISHORIZON_SHARED , VISHORIZON_CATALOG , VISHORIZON_DATA , VISHORIZON_TEMP } |
enum | KAXCompressReason { KAX_NO_SPACE , KAX_PRUNE , KAX_TRANSACTION_END , KAX_STARTUP_PROCESS_IDLE } |
Variables | |
static ProcArrayStruct * | procArray |
static PGPROC * | allProcs |
static TransactionId | cachedXidIsNotInProgress = InvalidTransactionId |
static TransactionId * | KnownAssignedXids |
static bool * | KnownAssignedXidsValid |
static TransactionId | latestObservedXid = InvalidTransactionId |
static TransactionId | standbySnapshotPendingXmin |
static GlobalVisState | GlobalVisSharedRels |
static GlobalVisState | GlobalVisCatalogRels |
static GlobalVisState | GlobalVisDataRels |
static GlobalVisState | GlobalVisTempRels |
static TransactionId | ComputeXidHorizonsResultLastXmin |
#define KAX_COMPRESS_FREQUENCY 128 /* in transactions */ |
#define KAX_COMPRESS_IDLE_INTERVAL 1000 /* in ms */ |
#define MAXAUTOVACPIDS 10 /* max autovacs to SIGTERM per iteration */ |
#define PROCARRAY_MAXPROCS (MaxBackends + max_prepared_xacts) |
#define TOTAL_MAX_CACHED_SUBXIDS ((PGPROC_MAX_CACHED_SUBXIDS + 1) * PROCARRAY_MAXPROCS) |
Definition at line 68 of file procarray.c.
#define xc_by_child_xid_inc | ( | ) | ((void) 0) |
Definition at line 340 of file procarray.c.
#define xc_by_known_assigned_inc | ( | ) | ((void) 0) |
Definition at line 341 of file procarray.c.
#define xc_by_known_xact_inc | ( | ) | ((void) 0) |
Definition at line 336 of file procarray.c.
#define xc_by_latest_xid_inc | ( | ) | ((void) 0) |
Definition at line 338 of file procarray.c.
#define xc_by_main_xid_inc | ( | ) | ((void) 0) |
Definition at line 339 of file procarray.c.
#define xc_by_my_xact_inc | ( | ) | ((void) 0) |
Definition at line 337 of file procarray.c.
#define xc_by_recent_xmin_inc | ( | ) | ((void) 0) |
Definition at line 335 of file procarray.c.
#define xc_no_overflow_inc | ( | ) | ((void) 0) |
Definition at line 342 of file procarray.c.
#define xc_slow_answer_inc | ( | ) | ((void) 0) |
Definition at line 343 of file procarray.c.
typedef struct ComputeXidHorizonsResult ComputeXidHorizonsResult |
typedef enum GlobalVisHorizonKind GlobalVisHorizonKind |
typedef enum KAXCompressReason KAXCompressReason |
typedef struct ProcArrayStruct ProcArrayStruct |
enum GlobalVisHorizonKind |
Enumerator | |
---|---|
VISHORIZON_SHARED | |
VISHORIZON_CATALOG | |
VISHORIZON_DATA | |
VISHORIZON_TEMP |
Definition at line 249 of file procarray.c.
enum KAXCompressReason |
Enumerator | |
---|---|
KAX_NO_SPACE | |
KAX_PRUNE | |
KAX_TRANSACTION_END | |
KAX_STARTUP_PROCESS_IDLE |
Definition at line 260 of file procarray.c.
PGPROC * BackendPidGetProc | ( | int | pid | ) |
Definition at line 3196 of file procarray.c.
References BackendPidGetProcWithLock(), LW_SHARED, LWLockAcquire(), and LWLockRelease().
Referenced by IsBackendPid(), pg_isolation_test_session_is_blocked(), pg_log_backend_memory_contexts(), pg_signal_backend(), pg_stat_get_activity(), pg_stat_get_backend_io(), pg_stat_get_backend_wait_event(), pg_stat_get_backend_wait_event_type(), pg_stat_reset_backend_stats(), TerminateOtherDBBackends(), and test_shm_mq_main().
PGPROC * BackendPidGetProcWithLock | ( | int | pid | ) |
Definition at line 3219 of file procarray.c.
References allProcs, ProcArrayStruct::numProcs, ProcArrayStruct::pgprocnos, PGPROC::pid, and procArray.
Referenced by BackendPidGetProc(), and GetBlockerStatusData().
int BackendXidGetPid | ( | TransactionId | xid | ) |
Definition at line 3256 of file procarray.c.
References allProcs, 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 3659 of file procarray.c.
References allProcs, PGPROC::databaseId, GET_VXID_FROM_PGPROC, InvalidOid, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), ProcArrayStruct::numProcs, ProcArrayStruct::pgprocnos, PGPROC::pid, procArray, VirtualTransactionId::procNumber, PGPROC::recoveryConflictPending, and SendProcSignal().
Referenced by ResolveRecoveryConflictWithDatabase(), and SendRecoveryConflictWithBufferPin().
pid_t CancelVirtualTransaction | ( | VirtualTransactionId | vxid, |
ProcSignalReason | sigmode | ||
) |
Definition at line 3491 of file procarray.c.
References SignalVirtualTransaction().
Referenced by ResolveRecoveryConflictWithVirtualXIDs().
|
static |
Definition at line 1735 of file procarray.c.
References allProcs, Assert, ComputeXidHorizonsResult::catalog_oldest_nonremovable, ComputeXidHorizonsResult::data_oldest_nonremovable, PGPROC::databaseId, GlobalVisUpdateApply(), InvalidOid, InvalidTransactionId, KnownAssignedXidsGetOldestXmin(), ComputeXidHorizonsResult::latest_completed, TransamVariablesData::latestCompletedXid, LW_SHARED, LWLockAcquire(), LWLockRelease(), MyDatabaseId, MyProc, ProcArrayStruct::numProcs, ComputeXidHorizonsResult::oldest_considered_running, ProcArrayStruct::pgprocnos, PROC_AFFECTS_ALL_HORIZONS, PROC_IN_LOGICAL_DECODING, PROC_IN_VACUUM, procArray, ProcGlobal, RecoveryInProgress(), ProcArrayStruct::replication_slot_catalog_xmin, ProcArrayStruct::replication_slot_xmin, ComputeXidHorizonsResult::shared_oldest_nonremovable, ComputeXidHorizonsResult::shared_oldest_nonremovable_raw, ComputeXidHorizonsResult::slot_catalog_xmin, ComputeXidHorizonsResult::slot_xmin, PROC_HDR::statusFlags, ComputeXidHorizonsResult::temp_oldest_nonremovable, TransactionIdAdvance, TransactionIdIsValid, TransactionIdOlder(), TransactionIdPrecedesOrEquals(), TransamVariables, UINT32_ACCESS_ONCE, PGPROC::xid, XidFromFullTransactionId, PROC_HDR::xids, and PGPROC::xmin.
Referenced by GetOldestNonRemovableTransactionId(), GetOldestTransactionIdConsideredRunning(), GetReplicationHorizons(), and GlobalVisUpdate().
int CountDBBackends | ( | Oid | databaseid | ) |
Definition at line 3599 of file procarray.c.
References allProcs, 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 3628 of file procarray.c.
References allProcs, PGPROC::databaseId, PGPROC::isRegularBackend, LW_SHARED, LWLockAcquire(), LWLockRelease(), ProcArrayStruct::numProcs, OidIsValid, ProcArrayStruct::pgprocnos, PGPROC::pid, and procArray.
Referenced by CheckMyDatabase().
bool CountOtherDBBackends | ( | Oid | databaseId, |
int * | nbackends, | ||
int * | nprepared | ||
) |
Definition at line 3750 of file procarray.c.
References allProcs, 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 3700 of file procarray.c.
References allProcs, PGPROC::isRegularBackend, LW_SHARED, LWLockAcquire(), LWLockRelease(), ProcArrayStruct::numProcs, ProcArrayStruct::pgprocnos, PGPROC::pid, procArray, and PGPROC::roleId.
Referenced by InitializeSessionUserId().
void ExpireAllKnownAssignedTransactionIds | ( | void | ) |
Definition at line 4498 of file procarray.c.
References InvalidTransactionId, KnownAssignedXidsRemovePreceding(), ProcArrayStruct::lastOverflowedXid, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), and procArray.
Referenced by ShutdownRecoveryTransactionEnvironment().
void ExpireOldKnownAssignedTransactionIds | ( | TransactionId | xid | ) |
Definition at line 4518 of file procarray.c.
References InvalidTransactionId, KnownAssignedXidsRemovePreceding(), ProcArrayStruct::lastOverflowedXid, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), procArray, and TransactionIdPrecedes().
Referenced by ProcArrayApplyRecoveryInfo().
void ExpireTreeKnownAssignedTransactionIds | ( | TransactionId | xid, |
int | nsubxids, | ||
TransactionId * | subxids, | ||
TransactionId | max_xid | ||
) |
Definition at line 4472 of file procarray.c.
References Assert, KnownAssignedXidsRemoveTree(), LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MaintainLatestCompletedXidRecovery(), STANDBY_INITIALIZED, standbyState, TransamVariables, and TransamVariablesData::xactCompletionCount.
Referenced by xact_redo_abort(), and xact_redo_commit().
|
inlinestatic |
Definition at line 4321 of file procarray.c.
References Assert, AssertTransactionIdInAllowableRange, FullTransactionIdFromU64(), TransactionIdIsValid, U64FromFullTransactionId, and XidFromFullTransactionId.
Referenced by GetSnapshotData(), GlobalVisTestIsRemovableXid(), GlobalVisUpdateApply(), MaintainLatestCompletedXid(), and MaintainLatestCompletedXidRecovery().
VirtualTransactionId * GetConflictingVirtualXIDs | ( | TransactionId | limitXmin, |
Oid | dbOid | ||
) |
Definition at line 3417 of file procarray.c.
References allProcs, PGPROC::databaseId, ereport, errcode(), errmsg(), ERROR, GET_VXID_FROM_PGPROC, INVALID_PROC_NUMBER, InvalidLocalTransactionId, VirtualTransactionId::localTransactionId, LW_SHARED, LWLockAcquire(), LWLockRelease(), malloc, ProcArrayStruct::maxProcs, ProcArrayStruct::numProcs, OidIsValid, ProcArrayStruct::pgprocnos, PGPROC::pid, procArray, VirtualTransactionId::procNumber, 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 3324 of file procarray.c.
References allProcs, 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 2080 of file procarray.c.
References TOTAL_MAX_CACHED_SUBXIDS.
Referenced by ExportSnapshot(), GetSnapshotData(), ImportSnapshot(), and SetTransactionSnapshot().
int GetMaxSnapshotXidCount | ( | void | ) |
Definition at line 2069 of file procarray.c.
References ProcArrayStruct::maxProcs, and procArray.
Referenced by GetSnapshotData(), ImportSnapshot(), SetTransactionSnapshot(), and SnapBuildInitialSnapshot().
TransactionId GetOldestActiveTransactionId | ( | void | ) |
Definition at line 2880 of file procarray.c.
References Assert, LW_SHARED, LWLockAcquire(), LWLockRelease(), TransamVariablesData::nextXid, ProcArrayStruct::numProcs, procArray, ProcGlobal, RecoveryInProgress(), TransactionIdIsNormal, TransactionIdPrecedes(), TransamVariables, UINT32_ACCESS_ONCE, XidFromFullTransactionId, and PROC_HDR::xids.
Referenced by CreateCheckPoint().
TransactionId GetOldestNonRemovableTransactionId | ( | Relation | rel | ) |
Definition at line 2005 of file procarray.c.
References ComputeXidHorizonsResult::catalog_oldest_nonremovable, ComputeXidHorizons(), ComputeXidHorizonsResult::data_oldest_nonremovable, GlobalVisHorizonKindForRel(), InvalidTransactionId, ComputeXidHorizonsResult::shared_oldest_nonremovable, ComputeXidHorizonsResult::temp_oldest_nonremovable, VISHORIZON_CATALOG, VISHORIZON_DATA, VISHORIZON_SHARED, and VISHORIZON_TEMP.
Referenced by _bt_pendingfsm_finalize(), acquire_sample_rows(), GetStrictOldestNonRemovableTransactionId(), heapam_index_build_range_scan(), statapprox_heap(), vac_update_datfrozenxid(), and vacuum_get_cutoffs().
TransactionId GetOldestSafeDecodingTransactionId | ( | bool | catalogOnly | ) |
Definition at line 2945 of file procarray.c.
References Assert, LW_SHARED, LWLockAcquire(), LWLockHeldByMe(), LWLockRelease(), TransamVariablesData::nextXid, ProcArrayStruct::numProcs, procArray, ProcGlobal, RecoveryInProgress(), ProcArrayStruct::replication_slot_catalog_xmin, ProcArrayStruct::replication_slot_xmin, TransactionIdIsNormal, TransactionIdIsValid, TransactionIdPrecedes(), TransamVariables, UINT32_ACCESS_ONCE, XidFromFullTransactionId, and PROC_HDR::xids.
Referenced by CreateInitDecodingContext(), SnapBuildInitialSnapshot(), and synchronize_one_slot().
TransactionId GetOldestTransactionIdConsideredRunning | ( | void | ) |
Definition at line 2034 of file procarray.c.
References ComputeXidHorizons(), and ComputeXidHorizonsResult::oldest_considered_running.
Referenced by CreateCheckPoint(), and CreateRestartPoint().
void GetReplicationHorizons | ( | TransactionId * | xmin, |
TransactionId * | catalog_xmin | ||
) |
Definition at line 2047 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 2689 of file procarray.c.
References allProcs, Assert, XidCacheStatus::count, PGPROC::databaseId, ereport, errcode(), errmsg(), ERROR, TransamVariablesData::latestCompletedXid, RunningTransactionsData::latestCompletedXid, LW_SHARED, LWLockAcquire(), malloc, MyDatabaseId, TransamVariablesData::nextXid, RunningTransactionsData::nextXid, ProcArrayStruct::numProcs, RunningTransactionsData::oldestDatabaseRunningXid, RunningTransactionsData::oldestRunningXid, XidCacheStatus::overflowed, pg_read_barrier, ProcArrayStruct::pgprocnos, procArray, ProcGlobal, RecoveryInProgress(), RunningTransactionsData::subxcnt, RunningTransactionsData::subxid_status, PGPROC::subxids, SUBXIDS_IN_ARRAY, SUBXIDS_IN_SUBTRANS, PROC_HDR::subxidStates, TOTAL_MAX_CACHED_SUBXIDS, TransactionIdIsNormal, TransactionIdIsValid, TransactionIdPrecedes(), TransamVariables, UINT32_ACCESS_ONCE, RunningTransactionsData::xcnt, XidFromFullTransactionId, XidCache::xids, PROC_HDR::xids, and RunningTransactionsData::xids.
Referenced by GetStrictOldestNonRemovableTransactionId(), and LogStandbySnapshot().
Definition at line 2175 of file procarray.c.
References SnapshotData::active_count, allProcs, Assert, SnapshotData::copied, XidCacheStatus::count, SnapshotData::curcid, GlobalVisState::definitely_needed, ereport, errcode(), errmsg(), ERROR, FullTransactionIdAdvance(), FullTransactionIdNewer(), FullXidRelativeTo(), GetCurrentCommandId(), GetMaxSnapshotSubxidCount(), GetMaxSnapshotXidCount(), GetSnapshotDataReuse(), GlobalVisCatalogRels, GlobalVisDataRels, GlobalVisSharedRels, GlobalVisTempRels, InvalidTransactionId, KnownAssignedXidsGetAndSetXmin(), ProcArrayStruct::lastOverflowedXid, TransamVariablesData::latestCompletedXid, likely, LW_SHARED, LWLockAcquire(), LWLockRelease(), malloc, GlobalVisState::maybe_needed, MyProc, NormalTransactionIdPrecedes, ProcArrayStruct::numProcs, TransamVariablesData::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, SnapshotData::snapXactCompletionCount, PROC_HDR::statusFlags, SnapshotData::suboverflowed, SnapshotData::subxcnt, PGPROC::subxids, PROC_HDR::subxidStates, SnapshotData::subxip, SnapshotData::takenDuringRecovery, TransactionIdAdvance, TransactionIdIsNormal, TransactionIdIsValid, TransactionIdOlder(), TransactionIdPrecedesOrEquals(), TransactionXmin, TransamVariables, UINT32_ACCESS_ONCE, TransamVariablesData::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().
|
static |
Definition at line 2095 of file procarray.c.
References SnapshotData::active_count, Assert, SnapshotData::copied, SnapshotData::curcid, GetCurrentCommandId(), LWLockHeldByMe(), MyProc, RecentXmin, SnapshotData::regd_count, SnapshotData::snapXactCompletionCount, TransactionIdIsValid, TransactionIdPrecedesOrEquals(), TransactionXmin, TransamVariables, unlikely, TransamVariablesData::xactCompletionCount, PGPROC::xmin, and SnapshotData::xmin.
Referenced by GetSnapshotData().
VirtualTransactionId * GetVirtualXIDsDelayingChkpt | ( | int * | nvxids, |
int | type | ||
) |
Definition at line 3043 of file procarray.c.
References allProcs, Assert, PGPROC::delayChkptFlags, GET_VXID_FROM_PGPROC, LW_SHARED, LWLockAcquire(), LWLockRelease(), ProcArrayStruct::maxProcs, ProcArrayStruct::numProcs, palloc(), ProcArrayStruct::pgprocnos, procArray, type, and VirtualTransactionIdIsValid.
Referenced by CreateCheckPoint().
bool GlobalVisCheckRemovableFullXid | ( | Relation | rel, |
FullTransactionId | fxid | ||
) |
Definition at line 4286 of file procarray.c.
References GlobalVisTestFor(), and GlobalVisTestIsRemovableFullXid().
Referenced by _bt_pendingfsm_finalize(), BTPageIsRecyclable(), and gistPageRecyclable().
bool GlobalVisCheckRemovableXid | ( | Relation | rel, |
TransactionId | xid | ||
) |
Definition at line 4300 of file procarray.c.
References GlobalVisTestFor(), and GlobalVisTestIsRemovableXid().
Referenced by GinPageIsRecyclable().
|
inlinestatic |
Definition at line 1971 of file procarray.c.
References Assert, IsCatalogRelation(), RelationData::rd_rel, RecoveryInProgress(), RELATION_IS_LOCAL, RelationIsAccessibleInLogicalDecoding, VISHORIZON_CATALOG, VISHORIZON_DATA, VISHORIZON_SHARED, and VISHORIZON_TEMP.
Referenced by GetOldestNonRemovableTransactionId(), and GlobalVisTestFor().
GlobalVisState * GlobalVisTestFor | ( | Relation | rel | ) |
Definition at line 4107 of file procarray.c.
References Assert, FullTransactionIdIsValid, GlobalVisCatalogRels, GlobalVisDataRels, GlobalVisHorizonKindForRel(), GlobalVisSharedRels, GlobalVisTempRels, RecentXmin, VISHORIZON_CATALOG, VISHORIZON_DATA, VISHORIZON_SHARED, and VISHORIZON_TEMP.
Referenced by get_actual_variable_endpoint(), GlobalVisCheckRemovableFullXid(), GlobalVisCheckRemovableXid(), heap_hot_search_buffer(), heap_index_delete_tuples(), heap_page_prune_opt(), heap_vacuum_rel(), and vacuumRedirectAndPlaceholder().
bool GlobalVisTestIsRemovableFullXid | ( | GlobalVisState * | state, |
FullTransactionId | fxid | ||
) |
Definition at line 4222 of file procarray.c.
References Assert, FullTransactionIdFollowsOrEquals, FullTransactionIdPrecedes, GlobalVisTestShouldUpdate(), and GlobalVisUpdate().
Referenced by GlobalVisCheckRemovableFullXid(), and GlobalVisTestIsRemovableXid().
bool GlobalVisTestIsRemovableXid | ( | GlobalVisState * | state, |
TransactionId | xid | ||
) |
Definition at line 4264 of file procarray.c.
References FullXidRelativeTo(), and GlobalVisTestIsRemovableFullXid().
Referenced by GlobalVisCheckRemovableXid(), heap_page_prune_opt(), heap_prune_satisfies_vacuum(), HeapTupleIsSurelyDead(), HeapTupleSatisfiesNonVacuumable(), and vacuumRedirectAndPlaceholder().
|
static |
Definition at line 4147 of file procarray.c.
References ComputeXidHorizonsResultLastXmin, FullTransactionIdFollowsOrEquals, RecentXmin, and TransactionIdIsValid.
Referenced by GlobalVisTestIsRemovableFullXid().
|
static |
Definition at line 4205 of file procarray.c.
References ComputeXidHorizons().
Referenced by GlobalVisTestIsRemovableFullXid().
|
static |
Definition at line 4166 of file procarray.c.
References ComputeXidHorizonsResult::catalog_oldest_nonremovable, ComputeXidHorizonsResultLastXmin, ComputeXidHorizonsResult::data_oldest_nonremovable, GlobalVisState::definitely_needed, FullTransactionIdNewer(), FullXidRelativeTo(), GlobalVisCatalogRels, GlobalVisDataRels, GlobalVisSharedRels, GlobalVisTempRels, ComputeXidHorizonsResult::latest_completed, GlobalVisState::maybe_needed, RecentXmin, ComputeXidHorizonsResult::shared_oldest_nonremovable, and ComputeXidHorizonsResult::temp_oldest_nonremovable.
Referenced by ComputeXidHorizons().
bool HaveVirtualXIDsDelayingChkpt | ( | VirtualTransactionId * | vxids, |
int | nvxids, | ||
int | type | ||
) |
Definition at line 3089 of file procarray.c.
References allProcs, Assert, PGPROC::delayChkptFlags, GET_VXID_FROM_PGPROC, i, LW_SHARED, LWLockAcquire(), LWLockRelease(), ProcArrayStruct::numProcs, ProcArrayStruct::pgprocnos, procArray, type, VirtualTransactionIdEquals, and VirtualTransactionIdIsValid.
Referenced by CreateCheckPoint().
bool IsBackendPid | ( | int | pid | ) |
Definition at line 3291 of file procarray.c.
References BackendPidGetProc().
Referenced by pg_stat_get_subscription().
void KnownAssignedTransactionIdsIdleMaintenance | ( | void | ) |
Definition at line 4540 of file procarray.c.
References KAX_STARTUP_PROCESS_IDLE, and KnownAssignedXidsCompress().
Referenced by WaitForWALToBecomeAvailable().
|
static |
Definition at line 4950 of file procarray.c.
References Assert, KnownAssignedXidsSearch(), and TransactionIdIsValid.
Referenced by TransactionIdIsInProgress().
|
static |
Definition at line 4758 of file procarray.c.
References Assert, elog, ERROR, ProcArrayStruct::headKnownAssignedXids, i, KAX_NO_SPACE, KnownAssignedXids, KnownAssignedXidsCompress(), KnownAssignedXidsDisplay(), KnownAssignedXidsValid, LOG, ProcArrayStruct::maxKnownAssignedXids, ProcArrayStruct::numKnownAssignedXids, pg_write_barrier, procArray, ProcArrayStruct::tailKnownAssignedXids, TransactionIdAdvance, TransactionIdFollowsOrEquals(), TransactionIdPrecedes(), and TransactionIdPrecedesOrEquals().
Referenced by ProcArrayApplyRecoveryInfo(), and RecordKnownAssignedTransactionIds().
|
static |
Definition at line 4641 of file procarray.c.
References Assert, GetCurrentTimestamp(), ProcArrayStruct::headKnownAssignedXids, i, KAX_COMPRESS_FREQUENCY, KAX_COMPRESS_IDLE_INTERVAL, KAX_NO_SPACE, KAX_STARTUP_PROCESS_IDLE, KAX_TRANSACTION_END, KnownAssignedXids, KnownAssignedXidsValid, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), ProcArrayStruct::numKnownAssignedXids, procArray, ProcArrayStruct::tailKnownAssignedXids, and TimestampTzPlusMilliseconds.
Referenced by KnownAssignedTransactionIdsIdleMaintenance(), KnownAssignedXidsAdd(), KnownAssignedXidsRemovePreceding(), and KnownAssignedXidsRemoveTree().
|
static |
Definition at line 5194 of file procarray.c.
References appendStringInfo(), buf, elog, ProcArrayStruct::headKnownAssignedXids, i, initStringInfo(), KnownAssignedXids, KnownAssignedXidsValid, ProcArrayStruct::numKnownAssignedXids, pfree(), procArray, and ProcArrayStruct::tailKnownAssignedXids.
Referenced by KnownAssignedXidsAdd(), and ProcArrayApplyRecoveryInfo().
|
static |
Definition at line 5089 of file procarray.c.
References InvalidTransactionId, and KnownAssignedXidsGetAndSetXmin().
Referenced by TransactionIdIsInProgress().
|
static |
Definition at line 5103 of file procarray.c.
References ProcArrayStruct::headKnownAssignedXids, i, KnownAssignedXids, KnownAssignedXidsValid, pg_read_barrier, procArray, ProcArrayStruct::tailKnownAssignedXids, TransactionIdFollowsOrEquals(), TransactionIdIsValid, and TransactionIdPrecedes().
Referenced by GetSnapshotData(), and KnownAssignedXidsGet().
|
static |
Definition at line 5159 of file procarray.c.
References ProcArrayStruct::headKnownAssignedXids, i, InvalidTransactionId, KnownAssignedXids, KnownAssignedXidsValid, pg_read_barrier, procArray, and ProcArrayStruct::tailKnownAssignedXids.
Referenced by ComputeXidHorizons().
|
static |
Definition at line 4963 of file procarray.c.
References Assert, DEBUG4, elog, KnownAssignedXidsSearch(), and TransactionIdIsValid.
Referenced by KnownAssignedXidsRemoveTree().
|
static |
Definition at line 5011 of file procarray.c.
References Assert, DEBUG4, elog, ProcArrayStruct::headKnownAssignedXids, i, KAX_PRUNE, KnownAssignedXids, KnownAssignedXidsCompress(), KnownAssignedXidsValid, ProcArrayStruct::numKnownAssignedXids, procArray, StandbyTransactionIdIsPrepared(), ProcArrayStruct::tailKnownAssignedXids, TransactionIdFollowsOrEquals(), and TransactionIdIsValid.
Referenced by ExpireAllKnownAssignedTransactionIds(), and ExpireOldKnownAssignedTransactionIds().
|
static |
Definition at line 4989 of file procarray.c.
References i, KAX_TRANSACTION_END, KnownAssignedXidsCompress(), KnownAssignedXidsRemove(), and TransactionIdIsValid.
Referenced by ExpireTreeKnownAssignedTransactionIds(), and ProcArrayApplyXidAssignment().
|
static |
Definition at line 5232 of file procarray.c.
References ProcArrayStruct::headKnownAssignedXids, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), ProcArrayStruct::numKnownAssignedXids, procArray, and ProcArrayStruct::tailKnownAssignedXids.
Referenced by ProcArrayApplyRecoveryInfo().
|
static |
Definition at line 4862 of file procarray.c.
References Assert, ProcArrayStruct::headKnownAssignedXids, KnownAssignedXids, KnownAssignedXidsValid, ProcArrayStruct::numKnownAssignedXids, pg_read_barrier, procArray, ProcArrayStruct::tailKnownAssignedXids, and TransactionIdPrecedes().
Referenced by KnownAssignedXidExists(), and KnownAssignedXidsRemove().
|
static |
Definition at line 967 of file procarray.c.
References Assert, FullTransactionIdIsNormal, FullTransactionIdIsValid, FullXidRelativeTo(), IsBootstrapProcessingMode, TransamVariablesData::latestCompletedXid, LWLockHeldByMe(), RecoveryInProgress(), TransactionIdPrecedes(), TransamVariables, and XidFromFullTransactionId.
Referenced by ProcArrayEndTransactionInternal(), ProcArrayRemove(), and XidCacheRemoveRunningXids().
|
static |
Definition at line 989 of file procarray.c.
References AmStartupProcess, Assert, FullTransactionIdIsNormal, FullTransactionIdIsValid, FullXidRelativeTo(), IsUnderPostmaster, TransamVariablesData::latestCompletedXid, LWLockHeldByMe(), TransamVariablesData::nextXid, TransactionIdPrecedes(), TransamVariables, and XidFromFullTransactionId.
Referenced by ExpireTreeKnownAssignedTransactionIds(), and ProcArrayApplyRecoveryInfo().
bool MinimumActiveBackends | ( | int | min | ) |
Definition at line 3546 of file procarray.c.
References allProcs, InvalidTransactionId, MyProc, ProcArrayStruct::numProcs, ProcArrayStruct::pgprocnos, PGPROC::pid, procArray, PGPROC::waitLock, and PGPROC::xid.
Referenced by XLogFlush().
void ProcArrayAdd | ( | PGPROC * | proc | ) |
Definition at line 468 of file procarray.c.
References allProcs, Assert, ereport, errcode(), errmsg(), FATAL, GetNumberFromPGProc, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), ProcArrayStruct::maxProcs, NUM_AUXILIARY_PROCS, ProcArrayStruct::numProcs, 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 1054 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(), TransamVariablesData::nextXid, RunningTransactionsData::nextXid, ProcArrayStruct::numKnownAssignedXids, RunningTransactionsData::oldestRunningXid, palloc(), pfree(), procArray, qsort, STANDBY_INITIALIZED, STANDBY_SNAPSHOT_PENDING, STANDBY_SNAPSHOT_READY, StandbyReleaseOldLocks(), standbySnapshotPendingXmin, standbyState, RunningTransactionsData::subxcnt, RunningTransactionsData::subxid_status, SUBXIDS_IN_ARRAY, SUBXIDS_IN_SUBTRANS, SUBXIDS_MISSING, TransactionIdAdvance, TransactionIdDidAbort(), TransactionIdDidCommit(), TransactionIdEquals, TransactionIdIsNormal, TransactionIdIsValid, TransactionIdPrecedes(), TransactionIdRetreat, TransamVariables, RunningTransactionsData::xcnt, xidLogicalComparator(), and RunningTransactionsData::xids.
Referenced by standby_redo(), StartupXLOG(), and xlog_redo().
void ProcArrayApplyXidAssignment | ( | TransactionId | topxid, |
int | nsubxids, | ||
TransactionId * | subxids | ||
) |
Definition at line 1318 of file procarray.c.
References Assert, i, InvalidTransactionId, KnownAssignedXidsRemoveTree(), ProcArrayStruct::lastOverflowedXid, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), procArray, RecordKnownAssignedTransactionIds(), STANDBY_INITIALIZED, standbyState, SubTransSetParent(), TransactionIdLatest(), and TransactionIdPrecedes().
Referenced by xact_redo().
void ProcArrayClearTransaction | ( | PGPROC * | proc | ) |
Definition at line 907 of file procarray.c.
References Assert, XidCacheStatus::count, PGPROC::delayChkptFlags, InvalidLocalTransactionId, InvalidTransactionId, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), PGPROC::lxid, XidCacheStatus::overflowed, PGPROC::pgxactoff, PROC_VACUUM_STATE_MASK, ProcGlobal, PGPROC::recoveryConflictPending, PGPROC::statusFlags, PROC_HDR::subxidStates, PGPROC::subxidStatus, TransamVariables, PGPROC::vxid, TransamVariablesData::xactCompletionCount, PGPROC::xid, PROC_HDR::xids, and PGPROC::xmin.
Referenced by PrepareTransaction().
void ProcArrayEndTransaction | ( | PGPROC * | proc, |
TransactionId | latestXid | ||
) |
Definition at line 667 of file procarray.c.
References Assert, XidCacheStatus::count, PGPROC::delayChkptFlags, 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::vxid, PGPROC::xid, and PGPROC::xmin.
Referenced by AbortTransaction(), and CommitTransaction().
|
inlinestatic |
Definition at line 731 of file procarray.c.
References Assert, XidCacheStatus::count, PGPROC::delayChkptFlags, InvalidLocalTransactionId, InvalidTransactionId, LW_EXCLUSIVE, LWLockHeldByMeInMode(), PGPROC::lxid, MaintainLatestCompletedXid(), XidCacheStatus::overflowed, PGPROC::pgxactoff, PROC_VACUUM_STATE_MASK, ProcGlobal, PGPROC::recoveryConflictPending, PGPROC::statusFlags, PROC_HDR::statusFlags, PROC_HDR::subxidStates, PGPROC::subxidStatus, TransactionIdIsValid, TransamVariables, PGPROC::vxid, TransamVariablesData::xactCompletionCount, PGPROC::xid, PROC_HDR::xids, and PGPROC::xmin.
Referenced by ProcArrayEndTransaction(), and ProcArrayGroupClearXid().
void ProcArrayGetReplicationSlotXmin | ( | TransactionId * | xmin, |
TransactionId * | catalog_xmin | ||
) |
Definition at line 3968 of file procarray.c.
References LW_SHARED, LWLockAcquire(), LWLockRelease(), procArray, ProcArrayStruct::replication_slot_catalog_xmin, and ProcArrayStruct::replication_slot_xmin.
Referenced by logical_begin_heap_rewrite().
|
static |
Definition at line 792 of file procarray.c.
References allProcs, Assert, GetNumberFromPGProc, INVALID_PROC_NUMBER, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MyProc, pg_atomic_compare_exchange_u32(), pg_atomic_exchange_u32(), pg_atomic_read_u32(), pg_atomic_write_u32(), pg_write_barrier, PGSemaphoreLock(), PGSemaphoreUnlock(), pgstat_report_wait_end(), pgstat_report_wait_start(), ProcArrayEndTransactionInternal(), PROC_HDR::procArrayGroupFirst, PGPROC::procArrayGroupMember, PGPROC::procArrayGroupMemberXid, PGPROC::procArrayGroupNext, ProcGlobal, PGPROC::sem, TransactionIdIsValid, and PGPROC::xid.
Referenced by ProcArrayEndTransaction().
void ProcArrayInitRecovery | ( | TransactionId | initializedUptoXID | ) |
Definition at line 1023 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 2532 of file procarray.c.
References allProcs, Assert, PGPROC::databaseId, VirtualTransactionId::localTransactionId, LW_SHARED, LWLockAcquire(), LWLockRelease(), PGPROC::lxid, MyDatabaseId, MyProc, ProcArrayStruct::numProcs, ProcArrayStruct::pgprocnos, PROC_IN_VACUUM, procArray, ProcGlobal, VirtualTransactionId::procNumber, PGPROC::procNumber, PROC_HDR::statusFlags, TransactionIdIsNormal, TransactionIdPrecedesOrEquals(), TransactionXmin, UINT32_ACCESS_ONCE, PGPROC::vxid, and PGPROC::xmin.
Referenced by GetSerializableTransactionSnapshotInt(), and SetTransactionSnapshot().
bool ProcArrayInstallRestoredXmin | ( | TransactionId | xmin, |
PGPROC * | proc | ||
) |
Definition at line 2616 of file procarray.c.
References Assert, PGPROC::databaseId, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MyDatabaseId, MyProc, PGPROC::pgxactoff, PROC_XMIN_FLAGS, ProcGlobal, PGPROC::statusFlags, PROC_HDR::statusFlags, TransactionIdIsNormal, TransactionIdPrecedesOrEquals(), TransactionXmin, UINT32_ACCESS_ONCE, and PGPROC::xmin.
Referenced by SetTransactionSnapshot().
void ProcArrayRemove | ( | PGPROC * | proc, |
TransactionId | latestXid | ||
) |
Definition at line 565 of file procarray.c.
References allProcs, PROC_HDR::allProcs, Assert, XidCacheStatus::count, InvalidTransactionId, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MaintainLatestCompletedXid(), ProcArrayStruct::maxProcs, NUM_AUXILIARY_PROCS, ProcArrayStruct::numProcs, XidCacheStatus::overflowed, ProcArrayStruct::pgprocnos, PGPROC::pgxactoff, PGPROC::pid, procArray, ProcGlobal, PROC_HDR::statusFlags, PROC_HDR::subxidStates, TransactionIdIsValid, TransamVariables, TransamVariablesData::xactCompletionCount, and PROC_HDR::xids.
Referenced by FinishPreparedTransaction(), and RemoveProcFromArray().
void ProcArraySetReplicationSlotXmin | ( | TransactionId | xmin, |
TransactionId | catalog_xmin, | ||
bool | already_locked | ||
) |
Definition at line 3943 of file procarray.c.
References Assert, DEBUG1, elog, LW_EXCLUSIVE, LWLockAcquire(), LWLockHeldByMe(), LWLockRelease(), procArray, ProcArrayStruct::replication_slot_catalog_xmin, and ProcArrayStruct::replication_slot_xmin.
Referenced by ReplicationSlotsComputeRequiredXmin().
void ProcArrayShmemInit | ( | void | ) |
Definition at line 418 of file procarray.c.
References add_size(), allProcs, PROC_HDR::allProcs, EnableHotStandby, ProcArrayStruct::headKnownAssignedXids, InvalidTransactionId, KnownAssignedXids, KnownAssignedXidsValid, ProcArrayStruct::lastOverflowedXid, ProcArrayStruct::maxKnownAssignedXids, ProcArrayStruct::maxProcs, mul_size(), ProcArrayStruct::numKnownAssignedXids, ProcArrayStruct::numProcs, procArray, PROCARRAY_MAXPROCS, ProcGlobal, ProcArrayStruct::replication_slot_catalog_xmin, ProcArrayStruct::replication_slot_xmin, ShmemInitStruct(), ProcArrayStruct::tailKnownAssignedXids, TOTAL_MAX_CACHED_SUBXIDS, TransamVariables, and TransamVariablesData::xactCompletionCount.
Referenced by CreateOrAttachShmemStructs().
Size ProcArrayShmemSize | ( | void | ) |
Definition at line 376 of file procarray.c.
References add_size(), EnableHotStandby, mul_size(), PROCARRAY_MAXPROCS, size, and TOTAL_MAX_CACHED_SUBXIDS.
Referenced by CalculateShmemSize().
PGPROC * ProcNumberGetProc | ( | ProcNumber | procNumber | ) |
Definition at line 3138 of file procarray.c.
References PROC_HDR::allProcCount, GetPGProcByNumber, PGPROC::pid, and ProcGlobal.
Referenced by checkTempNamespaceStatus(), LogRecoveryConflict(), VirtualXactLock(), WaitForLockersMultiple(), and WaitForOlderSnapshots().
void ProcNumberGetTransactionIds | ( | ProcNumber | procNumber, |
TransactionId * | xid, | ||
TransactionId * | xmin, | ||
int * | nsubxid, | ||
bool * | overflowed | ||
) |
Definition at line 3160 of file procarray.c.
References PROC_HDR::allProcCount, XidCacheStatus::count, GetPGProcByNumber, InvalidTransactionId, LW_SHARED, LWLockAcquire(), LWLockRelease(), XidCacheStatus::overflowed, PGPROC::pid, ProcGlobal, PGPROC::subxidStatus, PGPROC::xid, and PGPROC::xmin.
Referenced by pgstat_read_current_status().
void RecordKnownAssignedTransactionIds | ( | TransactionId | xid | ) |
Definition at line 4403 of file procarray.c.
References AdvanceNextFullTransactionIdPastXid(), Assert, DEBUG4, elog, ExtendSUBTRANS(), KnownAssignedXidsAdd(), latestObservedXid, STANDBY_INITIALIZED, standbyState, TransactionIdAdvance, TransactionIdFollows(), TransactionIdIsValid, and TransactionIdPrecedes().
Referenced by ApplyWalRecord(), ProcArrayApplyXidAssignment(), xact_redo_abort(), and xact_redo_commit().
pid_t SignalVirtualTransaction | ( | VirtualTransactionId | vxid, |
ProcSignalReason | sigmode, | ||
bool | conflictPending | ||
) |
Definition at line 3497 of file procarray.c.
References allProcs, GET_VXID_FROM_PGPROC, VirtualTransactionId::localTransactionId, LW_SHARED, LWLockAcquire(), LWLockRelease(), ProcArrayStruct::numProcs, ProcArrayStruct::pgprocnos, PGPROC::pid, procArray, VirtualTransactionId::procNumber, PGPROC::recoveryConflictPending, and SendProcSignal().
Referenced by CancelVirtualTransaction(), and ResolveRecoveryConflictWithLock().
void TerminateOtherDBBackends | ( | Oid | databaseId | ) |
Definition at line 3828 of file procarray.c.
References allProcs, BackendPidGetProc(), PGPROC::databaseId, ereport, errcode(), errdetail(), 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 1634 of file procarray.c.
References allProcs, 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 1402 of file procarray.c.
References allProcs, Assert, cachedXidIsNotInProgress, XidCacheStatus::count, ereport, errcode(), errmsg(), ERROR, j, KnownAssignedXidExists(), KnownAssignedXidsGet(), ProcArrayStruct::lastOverflowedXid, TransamVariablesData::latestCompletedXid, LW_SHARED, LWLockAcquire(), LWLockRelease(), malloc, ProcArrayStruct::maxProcs, MyProc, ProcArrayStruct::numProcs, pg_lfind32(), pg_read_barrier, ProcArrayStruct::pgprocnos, PGPROC::pgxactoff, procArray, ProcGlobal, RecentXmin, RecoveryInProgress(), SubTransGetTopmostTransaction(), PGPROC::subxids, PROC_HDR::subxidStates, TOTAL_MAX_CACHED_SUBXIDS, TransactionIdDidAbort(), TransactionIdEquals, TransactionIdIsCurrentTransactionId(), TransactionIdIsValid, TransactionIdPrecedes(), TransactionIdPrecedesOrEquals(), TransamVariables, 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(), get_xid_status(), HandleConcurrentAbort(), HeapTupleHeaderIsOnlyLocked(), HeapTupleSatisfiesDirty(), HeapTupleSatisfiesSelf(), HeapTupleSatisfiesToast(), HeapTupleSatisfiesUpdate(), HeapTupleSatisfiesVacuumHorizon(), MultiXactIdExpand(), MultiXactIdIsRunning(), pg_xact_status(), test_lockmode_for_conflict(), verify_heapam(), and XactLockTableWait().
void XidCacheRemoveRunningXids | ( | TransactionId | xid, |
int | nxids, | ||
const TransactionId * | xids, | ||
TransactionId | latestXid | ||
) |
Definition at line 3991 of file procarray.c.
References Assert, XidCacheStatus::count, elog, i, j, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MaintainLatestCompletedXid(), MyProc, pg_write_barrier, PGPROC::pgxactoff, ProcGlobal, PGPROC::subxids, PROC_HDR::subxidStates, PGPROC::subxidStatus, TransactionIdEquals, TransactionIdIsValid, TransamVariables, WARNING, TransamVariablesData::xactCompletionCount, and XidCache::xids.
Referenced by RecordTransactionAbort().
|
static |
Definition at line 271 of file procarray.c.
Referenced by BackendPidGetProcWithLock(), BackendXidGetPid(), CancelDBBackends(), ComputeXidHorizons(), CountDBBackends(), CountDBConnections(), CountOtherDBBackends(), CountUserBackends(), GetConflictingVirtualXIDs(), GetCurrentVirtualXIDs(), GetRunningTransactionData(), GetSnapshotData(), GetVirtualXIDsDelayingChkpt(), HaveVirtualXIDsDelayingChkpt(), MinimumActiveBackends(), ProcArrayAdd(), ProcArrayGroupClearXid(), ProcArrayInstallImportedXmin(), ProcArrayRemove(), ProcArrayShmemInit(), SignalVirtualTransaction(), TerminateOtherDBBackends(), TransactionIdIsActive(), and TransactionIdIsInProgress().
|
static |
Definition at line 276 of file procarray.c.
Referenced by TransactionIdIsInProgress().
|
static |
Definition at line 307 of file procarray.c.
Referenced by GlobalVisTestShouldUpdate(), and GlobalVisUpdateApply().
|
static |
Definition at line 298 of file procarray.c.
Referenced by GetSnapshotData(), GlobalVisTestFor(), and GlobalVisUpdateApply().
|
static |
Definition at line 299 of file procarray.c.
Referenced by GetSnapshotData(), GlobalVisTestFor(), and GlobalVisUpdateApply().
|
static |
Definition at line 297 of file procarray.c.
Referenced by GetSnapshotData(), GlobalVisTestFor(), and GlobalVisUpdateApply().
|
static |
Definition at line 300 of file procarray.c.
Referenced by GetSnapshotData(), GlobalVisTestFor(), and GlobalVisUpdateApply().
|
static |
Definition at line 281 of file procarray.c.
Referenced by KnownAssignedXidsAdd(), KnownAssignedXidsCompress(), KnownAssignedXidsDisplay(), KnownAssignedXidsGetAndSetXmin(), KnownAssignedXidsGetOldestXmin(), KnownAssignedXidsRemovePreceding(), KnownAssignedXidsSearch(), and ProcArrayShmemInit().
|
static |
Definition at line 282 of file procarray.c.
Referenced by KnownAssignedXidsAdd(), KnownAssignedXidsCompress(), KnownAssignedXidsDisplay(), KnownAssignedXidsGetAndSetXmin(), KnownAssignedXidsGetOldestXmin(), KnownAssignedXidsRemovePreceding(), KnownAssignedXidsSearch(), and ProcArrayShmemInit().
|
static |
Definition at line 283 of file procarray.c.
Referenced by ProcArrayApplyRecoveryInfo(), ProcArrayInitRecovery(), and RecordKnownAssignedTransactionIds().
|
static |
Definition at line 269 of file procarray.c.
Referenced by BackendPidGetProcWithLock(), BackendXidGetPid(), CancelDBBackends(), ComputeXidHorizons(), CountDBBackends(), CountDBConnections(), CountOtherDBBackends(), CountUserBackends(), ExpireAllKnownAssignedTransactionIds(), ExpireOldKnownAssignedTransactionIds(), GetConflictingVirtualXIDs(), GetCurrentVirtualXIDs(), GetMaxSnapshotXidCount(), GetOldestActiveTransactionId(), GetOldestSafeDecodingTransactionId(), GetRunningTransactionData(), GetSnapshotData(), GetVirtualXIDsDelayingChkpt(), HaveVirtualXIDsDelayingChkpt(), KnownAssignedXidsAdd(), KnownAssignedXidsCompress(), KnownAssignedXidsDisplay(), KnownAssignedXidsGetAndSetXmin(), KnownAssignedXidsGetOldestXmin(), KnownAssignedXidsRemovePreceding(), KnownAssignedXidsReset(), KnownAssignedXidsSearch(), MinimumActiveBackends(), ProcArrayAdd(), ProcArrayApplyRecoveryInfo(), ProcArrayApplyXidAssignment(), ProcArrayGetReplicationSlotXmin(), ProcArrayInstallImportedXmin(), ProcArrayRemove(), ProcArraySetReplicationSlotXmin(), ProcArrayShmemInit(), SignalVirtualTransaction(), TerminateOtherDBBackends(), TransactionIdIsActive(), and TransactionIdIsInProgress().
|
static |
Definition at line 290 of file procarray.c.
Referenced by ProcArrayApplyRecoveryInfo().