Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef PROCARRAY_H
00015 #define PROCARRAY_H
00016
00017 #include "storage/standby.h"
00018 #include "utils/snapshot.h"
00019
00020
00021 extern Size ProcArrayShmemSize(void);
00022 extern void CreateSharedProcArray(void);
00023 extern void ProcArrayAdd(PGPROC *proc);
00024 extern void ProcArrayRemove(PGPROC *proc, TransactionId latestXid);
00025
00026 extern void ProcArrayEndTransaction(PGPROC *proc, TransactionId latestXid);
00027 extern void ProcArrayClearTransaction(PGPROC *proc);
00028
00029 extern void ProcArrayApplyRecoveryInfo(RunningTransactions running);
00030 extern void ProcArrayApplyXidAssignment(TransactionId topxid,
00031 int nsubxids, TransactionId *subxids);
00032
00033 extern void RecordKnownAssignedTransactionIds(TransactionId xid);
00034 extern void ExpireTreeKnownAssignedTransactionIds(TransactionId xid,
00035 int nsubxids, TransactionId *subxids,
00036 TransactionId max_xid);
00037 extern void ExpireAllKnownAssignedTransactionIds(void);
00038 extern void ExpireOldKnownAssignedTransactionIds(TransactionId xid);
00039
00040 extern int GetMaxSnapshotXidCount(void);
00041 extern int GetMaxSnapshotSubxidCount(void);
00042
00043 extern Snapshot GetSnapshotData(Snapshot snapshot);
00044
00045 extern bool ProcArrayInstallImportedXmin(TransactionId xmin,
00046 TransactionId sourcexid);
00047
00048 extern RunningTransactions GetRunningTransactionData(void);
00049
00050 extern bool TransactionIdIsInProgress(TransactionId xid);
00051 extern bool TransactionIdIsActive(TransactionId xid);
00052 extern TransactionId GetOldestXmin(bool allDbs, bool ignoreVacuum);
00053 extern TransactionId GetOldestActiveTransactionId(void);
00054
00055 extern VirtualTransactionId *GetVirtualXIDsDelayingChkpt(int *nvxids);
00056 extern bool HaveVirtualXIDsDelayingChkpt(VirtualTransactionId *vxids, int nvxids);
00057
00058 extern PGPROC *BackendPidGetProc(int pid);
00059 extern int BackendXidGetPid(TransactionId xid);
00060 extern bool IsBackendPid(int pid);
00061
00062 extern VirtualTransactionId *GetCurrentVirtualXIDs(TransactionId limitXmin,
00063 bool excludeXmin0, bool allDbs, int excludeVacuum,
00064 int *nvxids);
00065 extern VirtualTransactionId *GetConflictingVirtualXIDs(TransactionId limitXmin, Oid dbOid);
00066 extern pid_t CancelVirtualTransaction(VirtualTransactionId vxid, ProcSignalReason sigmode);
00067
00068 extern bool MinimumActiveBackends(int min);
00069 extern int CountDBBackends(Oid databaseid);
00070 extern void CancelDBBackends(Oid databaseid, ProcSignalReason sigmode, bool conflictPending);
00071 extern int CountUserBackends(Oid roleid);
00072 extern bool CountOtherDBBackends(Oid databaseId,
00073 int *nbackends, int *nprepared);
00074
00075 extern void XidCacheRemoveRunningXids(TransactionId xid,
00076 int nxids, const TransactionId *xids,
00077 TransactionId latestXid);
00078
00079 #endif