PostgreSQL Source Code  git master
proc.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * proc.h
4  * per-process shared memory data structures
5  *
6  *
7  * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/storage/proc.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef _PROC_H_
15 #define _PROC_H_
16 
17 #include "access/clog.h"
18 #include "access/xlogdefs.h"
19 #include "lib/ilist.h"
20 #include "storage/latch.h"
21 #include "storage/lock.h"
22 #include "storage/pg_sema.h"
23 #include "storage/proclist_types.h"
24 
25 /*
26  * Each backend advertises up to PGPROC_MAX_CACHED_SUBXIDS TransactionIds
27  * for non-aborted subtransactions of its current top transaction. These
28  * have to be treated as running XIDs by other backends.
29  *
30  * We also keep track of whether the cache overflowed (ie, the transaction has
31  * generated at least one subtransaction that didn't fit in the cache).
32  * If none of the caches have overflowed, we can assume that an XID that's not
33  * listed anywhere in the PGPROC array is not a running transaction. Else we
34  * have to look at pg_subtrans.
35  */
36 #define PGPROC_MAX_CACHED_SUBXIDS 64 /* XXX guessed-at value */
37 
38 typedef struct XidCacheStatus
39 {
40  /* number of cached subxids, never more than PGPROC_MAX_CACHED_SUBXIDS */
42  /* has PGPROC->subxids overflowed */
43  bool overflowed;
45 
46 struct XidCache
47 {
49 };
50 
51 /*
52  * Flags for PGPROC->statusFlags and PROC_HDR->statusFlags[]
53  */
54 #define PROC_IS_AUTOVACUUM 0x01 /* is it an autovac worker? */
55 #define PROC_IN_VACUUM 0x02 /* currently running lazy vacuum */
56 #define PROC_IN_SAFE_IC 0x04 /* currently running CREATE INDEX
57  * CONCURRENTLY or REINDEX
58  * CONCURRENTLY on non-expressional,
59  * non-partial index */
60 #define PROC_VACUUM_FOR_WRAPAROUND 0x08 /* set by autovac only */
61 #define PROC_IN_LOGICAL_DECODING 0x10 /* currently doing logical
62  * decoding outside xact */
63 #define PROC_AFFECTS_ALL_HORIZONS 0x20 /* this proc's xmin must be
64  * included in vacuum horizons
65  * in all databases */
66 
67 /* flags reset at EOXact */
68 #define PROC_VACUUM_STATE_MASK \
69  (PROC_IN_VACUUM | PROC_IN_SAFE_IC | PROC_VACUUM_FOR_WRAPAROUND)
70 
71 /*
72  * Xmin-related flags. Make sure any flags that affect how the process' Xmin
73  * value is interpreted by VACUUM are included here.
74  */
75 #define PROC_XMIN_FLAGS (PROC_IN_VACUUM | PROC_IN_SAFE_IC)
76 
77 /*
78  * We allow a small number of "weak" relation locks (AccessShareLock,
79  * RowShareLock, RowExclusiveLock) to be recorded in the PGPROC structure
80  * rather than the main lock table. This eases contention on the lock
81  * manager LWLocks. See storage/lmgr/README for additional details.
82  */
83 #define FP_LOCK_SLOTS_PER_BACKEND 16
84 
85 /*
86  * An invalid pgprocno. Must be larger than the maximum number of PGPROC
87  * structures we could possibly have. See comments for MAX_BACKENDS.
88  */
89 #define INVALID_PGPROCNO PG_INT32_MAX
90 
91 /*
92  * Flags for PGPROC.delayChkpt
93  *
94  * These flags can be used to delay the start or completion of a checkpoint
95  * for short periods. A flag is in effect if the corresponding bit is set in
96  * the PGPROC of any backend.
97  *
98  * For our purposes here, a checkpoint has three phases: (1) determine the
99  * location to which the redo pointer will be moved, (2) write all the
100  * data durably to disk, and (3) WAL-log the checkpoint.
101  *
102  * Setting DELAY_CHKPT_START prevents the system from moving from phase 1
103  * to phase 2. This is useful when we are performing a WAL-logged modification
104  * of data that will be flushed to disk in phase 2. By setting this flag
105  * before writing WAL and clearing it after we've both written WAL and
106  * performed the corresponding modification, we ensure that if the WAL record
107  * is inserted prior to the new redo point, the corresponding data changes will
108  * also be flushed to disk before the checkpoint can complete. (In the
109  * extremely common case where the data being modified is in shared buffers
110  * and we acquire an exclusive content lock on the relevant buffers before
111  * writing WAL, this mechanism is not needed, because phase 2 will block
112  * until we release the content lock and then flush the modified data to
113  * disk.)
114  *
115  * Setting DELAY_CHKPT_COMPLETE prevents the system from moving from phase 2
116  * to phase 3. This is useful if we are performing a WAL-logged operation that
117  * might invalidate buffers, such as relation truncation. In this case, we need
118  * to ensure that any buffers which were invalidated and thus not flushed by
119  * the checkpoint are actaully destroyed on disk. Replay can cope with a file
120  * or block that doesn't exist, but not with a block that has the wrong
121  * contents.
122  */
123 #define DELAY_CHKPT_START (1<<0)
124 #define DELAY_CHKPT_COMPLETE (1<<1)
125 
126 typedef enum
127 {
132 
133 /*
134  * Each backend has a PGPROC struct in shared memory. There is also a list of
135  * currently-unused PGPROC structs that will be reallocated to new backends.
136  *
137  * links: list link for any list the PGPROC is in. When waiting for a lock,
138  * the PGPROC is linked into that lock's waitProcs queue. A recycled PGPROC
139  * is linked into ProcGlobal's freeProcs list.
140  *
141  * Note: twophase.c also sets up a dummy PGPROC struct for each currently
142  * prepared transaction. These PGPROCs appear in the ProcArray data structure
143  * so that the prepared transactions appear to be still running and are
144  * correctly shown as holding locks. A prepared transaction PGPROC can be
145  * distinguished from a real one at need by the fact that it has pid == 0.
146  * The semaphore and lock-activity fields in a prepared-xact PGPROC are unused,
147  * but its myProcLocks[] lists are valid.
148  *
149  * We allow many fields of this struct to be accessed without locks, such as
150  * delayChkpt and isBackgroundWorker. However, keep in mind that writing
151  * mirrored ones (see below) requires holding ProcArrayLock or XidGenLock in
152  * at least shared mode, so that pgxactoff does not change concurrently.
153  *
154  * Mirrored fields:
155  *
156  * Some fields in PGPROC (see "mirrored in ..." comment) are mirrored into an
157  * element of more densely packed ProcGlobal arrays. These arrays are indexed
158  * by PGPROC->pgxactoff. Both copies need to be maintained coherently.
159  *
160  * NB: The pgxactoff indexed value can *never* be accessed without holding
161  * locks.
162  *
163  * See PROC_HDR for details.
164  */
165 struct PGPROC
166 {
167  /* proc->links MUST BE FIRST IN STRUCT (see ProcSleep,ProcWakeup,etc) */
168  SHM_QUEUE links; /* list link if process is in a list */
169  PGPROC **procgloballist; /* procglobal list that owns this PGPROC */
170 
171  PGSemaphore sem; /* ONE semaphore to sleep on */
173 
174  Latch procLatch; /* generic latch for process */
175 
176 
177  TransactionId xid; /* id of top-level transaction currently being
178  * executed by this proc, if running and XID
179  * is assigned; else InvalidTransactionId.
180  * mirrored in ProcGlobal->xids[pgxactoff] */
181 
182  TransactionId xmin; /* minimal running XID as it was when we were
183  * starting our xact, excluding LAZY VACUUM:
184  * vacuum must not remove tuples deleted by
185  * xid >= xmin ! */
186 
187  LocalTransactionId lxid; /* local id of top-level transaction currently
188  * being executed by this proc, if running;
189  * else InvalidLocalTransactionId */
190  int pid; /* Backend's process ID; 0 if prepared xact */
191 
192  int pgxactoff; /* offset into various ProcGlobal->arrays with
193  * data mirrored from this PGPROC */
194  int pgprocno;
195 
196  /* These fields are zero while a backend is still starting up: */
197  BackendId backendId; /* This backend's backend ID (if assigned) */
198  Oid databaseId; /* OID of database this backend is using */
199  Oid roleId; /* OID of role using this backend */
200 
201  Oid tempNamespaceId; /* OID of temp schema this backend is
202  * using */
203 
204  bool isBackgroundWorker; /* true if background worker. */
205 
206  /*
207  * While in hot standby mode, shows that a conflict signal has been sent
208  * for the current transaction. Set/cleared while holding ProcArrayLock,
209  * though not required. Accessed without lock, if needed.
210  */
212 
213  /* Info about LWLock the process is currently waiting for, if any. */
214  bool lwWaiting; /* true if waiting for an LW lock */
215  uint8 lwWaitMode; /* lwlock mode being waited for */
216  proclist_node lwWaitLink; /* position in LW lock wait list */
217 
218  /* Support for condition variables. */
219  proclist_node cvWaitLink; /* position in CV wait list */
220 
221  /* Info about lock the process is currently waiting for, if any. */
222  /* waitLock and waitProcLock are NULL if not currently waiting. */
223  LOCK *waitLock; /* Lock object we're sleeping on ... */
224  PROCLOCK *waitProcLock; /* Per-holder info for awaited lock */
225  LOCKMODE waitLockMode; /* type of lock we're waiting for */
226  LOCKMASK heldLocks; /* bitmask for lock types already held on this
227  * lock object by this backend */
228  pg_atomic_uint64 waitStart; /* time at which wait for lock acquisition
229  * started */
230 
231  int delayChkptFlags; /* for DELAY_CHKPT_* flags */
232 
233  uint8 statusFlags; /* this backend's status flags, see PROC_*
234  * above. mirrored in
235  * ProcGlobal->statusFlags[pgxactoff] */
236 
237  /*
238  * Info to allow us to wait for synchronous replication, if needed.
239  * waitLSN is InvalidXLogRecPtr if not waiting; set only by user backend.
240  * syncRepState must not be touched except by owning process or WALSender.
241  * syncRepLinks used only while holding SyncRepLock.
242  */
243  XLogRecPtr waitLSN; /* waiting for this LSN or higher */
244  int syncRepState; /* wait state for sync rep */
245  SHM_QUEUE syncRepLinks; /* list link if process is in syncrep queue */
246 
247  /*
248  * All PROCLOCK objects for locks held or awaited by this backend are
249  * linked into one of these lists, according to the partition number of
250  * their lock.
251  */
253 
254  XidCacheStatus subxidStatus; /* mirrored with
255  * ProcGlobal->subxidStates[i] */
256  struct XidCache subxids; /* cache for subtransaction XIDs */
257 
258  /* Support for group XID clearing. */
259  /* true, if member of ProcArray group waiting for XID clear */
261  /* next ProcArray group member waiting for XID clear */
263 
264  /*
265  * latest transaction id among the transaction's main XID and
266  * subtransactions
267  */
269 
270  uint32 wait_event_info; /* proc's wait information */
271 
272  /* Support for group transaction status update. */
273  bool clogGroupMember; /* true, if member of clog group */
274  pg_atomic_uint32 clogGroupNext; /* next clog group member */
275  TransactionId clogGroupMemberXid; /* transaction id of clog group member */
276  XidStatus clogGroupMemberXidStatus; /* transaction status of clog
277  * group member */
278  int clogGroupMemberPage; /* clog page corresponding to
279  * transaction id of clog group member */
280  XLogRecPtr clogGroupMemberLsn; /* WAL location of commit record for clog
281  * group member */
282 
283  /* Lock manager data, recording fast-path locks taken by this backend. */
284  LWLock fpInfoLock; /* protects per-backend fast-path state */
285  uint64 fpLockBits; /* lock modes held for each fast-path slot */
286  Oid fpRelId[FP_LOCK_SLOTS_PER_BACKEND]; /* slots for rel oids */
287  bool fpVXIDLock; /* are we holding a fast-path VXID lock? */
288  LocalTransactionId fpLocalTransactionId; /* lxid for fast-path VXID
289  * lock */
290 
291  /*
292  * Support for lock groups. Use LockHashPartitionLockByProc on the group
293  * leader to get the LWLock protecting these fields.
294  */
295  PGPROC *lockGroupLeader; /* lock group leader, if I'm a member */
296  dlist_head lockGroupMembers; /* list of members, if I'm a leader */
297  dlist_node lockGroupLink; /* my member link, if I'm a member */
298 };
299 
300 /* NOTE: "typedef struct PGPROC PGPROC" appears in storage/lock.h. */
301 
302 
303 extern PGDLLIMPORT PGPROC *MyProc;
304 
305 /*
306  * There is one ProcGlobal struct for the whole database cluster.
307  *
308  * Adding/Removing an entry into the procarray requires holding *both*
309  * ProcArrayLock and XidGenLock in exclusive mode (in that order). Both are
310  * needed because the dense arrays (see below) are accessed from
311  * GetNewTransactionId() and GetSnapshotData(), and we don't want to add
312  * further contention by both using the same lock. Adding/Removing a procarray
313  * entry is much less frequent.
314  *
315  * Some fields in PGPROC are mirrored into more densely packed arrays (e.g.
316  * xids), with one entry for each backend. These arrays only contain entries
317  * for PGPROCs that have been added to the shared array with ProcArrayAdd()
318  * (in contrast to PGPROC array which has unused PGPROCs interspersed).
319  *
320  * The dense arrays are indexed by PGPROC->pgxactoff. Any concurrent
321  * ProcArrayAdd() / ProcArrayRemove() can lead to pgxactoff of a procarray
322  * member to change. Therefore it is only safe to use PGPROC->pgxactoff to
323  * access the dense array while holding either ProcArrayLock or XidGenLock.
324  *
325  * As long as a PGPROC is in the procarray, the mirrored values need to be
326  * maintained in both places in a coherent manner.
327  *
328  * The denser separate arrays are beneficial for three main reasons: First, to
329  * allow for as tight loops accessing the data as possible. Second, to prevent
330  * updates of frequently changing data (e.g. xmin) from invalidating
331  * cachelines also containing less frequently changing data (e.g. xid,
332  * statusFlags). Third to condense frequently accessed data into as few
333  * cachelines as possible.
334  *
335  * There are two main reasons to have the data mirrored between these dense
336  * arrays and PGPROC. First, as explained above, a PGPROC's array entries can
337  * only be accessed with either ProcArrayLock or XidGenLock held, whereas the
338  * PGPROC entries do not require that (obviously there may still be locking
339  * requirements around the individual field, separate from the concerns
340  * here). That is particularly important for a backend to efficiently checks
341  * it own values, which it often can safely do without locking. Second, the
342  * PGPROC fields allow to avoid unnecessary accesses and modification to the
343  * dense arrays. A backend's own PGPROC is more likely to be in a local cache,
344  * whereas the cachelines for the dense array will be modified by other
345  * backends (often removing it from the cache for other cores/sockets). At
346  * commit/abort time a check of the PGPROC value can avoid accessing/dirtying
347  * the corresponding array value.
348  *
349  * Basically it makes sense to access the PGPROC variable when checking a
350  * single backend's data, especially when already looking at the PGPROC for
351  * other reasons already. It makes sense to look at the "dense" arrays if we
352  * need to look at many / most entries, because we then benefit from the
353  * reduced indirection and better cross-process cache-ability.
354  *
355  * When entering a PGPROC for 2PC transactions with ProcArrayAdd(), the data
356  * in the dense arrays is initialized from the PGPROC while it already holds
357  * ProcArrayLock.
358  */
359 typedef struct PROC_HDR
360 {
361  /* Array of PGPROC structures (not including dummies for prepared txns) */
362  PGPROC *allProcs;
363 
364  /* Array mirroring PGPROC.xid for each PGPROC currently in the procarray */
366 
367  /*
368  * Array mirroring PGPROC.subxidStatus for each PGPROC currently in the
369  * procarray.
370  */
372 
373  /*
374  * Array mirroring PGPROC.statusFlags for each PGPROC currently in the
375  * procarray.
376  */
378 
379  /* Length of allProcs array */
381  /* Head of list of free PGPROC structures */
383  /* Head of list of autovacuum's free PGPROC structures */
385  /* Head of list of bgworker free PGPROC structures */
387  /* Head of list of walsender free PGPROC structures */
389  /* First pgproc waiting for group XID clear */
391  /* First pgproc waiting for group transaction status update */
393  /* WALWriter process's latch */
395  /* Checkpointer process's latch */
397  /* Current shared estimate of appropriate spins_per_delay value */
398  int spins_per_delay;
399  /* Buffer id of the buffer that Startup process waits for pin on, or -1 */
401 } PROC_HDR;
402 
404 
406 
407 /* Accessor for PGPROC given a pgprocno. */
408 #define GetPGProcByNumber(n) (&ProcGlobal->allProcs[(n)])
409 
410 /*
411  * We set aside some extra PGPROC structures for auxiliary processes,
412  * ie things that aren't full-fledged backends but need shmem access.
413  *
414  * Background writer, checkpointer, WAL writer and archiver run during normal
415  * operation. Startup process and WAL receiver also consume 2 slots, but WAL
416  * writer is launched only after startup has exited, so we only need 5 slots.
417  */
418 #define NUM_AUXILIARY_PROCS 5
419 
420 /* configurable options */
421 extern PGDLLIMPORT int DeadlockTimeout;
422 extern PGDLLIMPORT int StatementTimeout;
423 extern PGDLLIMPORT int LockTimeout;
426 extern PGDLLIMPORT bool log_lock_waits;
427 
428 
429 /*
430  * Function Prototypes
431  */
432 extern int ProcGlobalSemas(void);
433 extern Size ProcGlobalShmemSize(void);
434 extern void InitProcGlobal(void);
435 extern void InitProcess(void);
436 extern void InitProcessPhase2(void);
437 extern void InitAuxiliaryProcess(void);
438 
439 extern void SetStartupBufferPinWaitBufId(int bufid);
440 extern int GetStartupBufferPinWaitBufId(void);
441 
442 extern bool HaveNFreeProcs(int n);
443 extern void ProcReleaseLocks(bool isCommit);
444 
445 extern void ProcQueueInit(PROC_QUEUE *queue);
446 extern ProcWaitStatus ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable);
447 extern PGPROC *ProcWakeup(PGPROC *proc, ProcWaitStatus waitStatus);
448 extern void ProcLockWakeup(LockMethod lockMethodTable, LOCK *lock);
449 extern void CheckDeadLockAlert(void);
450 extern bool IsWaitingForLock(void);
451 extern void LockErrorCleanup(void);
452 
453 extern void ProcWaitForSignal(uint32 wait_event_info);
454 extern void ProcSendSignal(int pgprocno);
455 
456 extern PGPROC *AuxiliaryPidGetProc(int pid);
457 
458 extern void BecomeLockGroupLeader(void);
459 extern bool BecomeLockGroupMember(PGPROC *leader, int pid);
460 
461 #endif /* _PROC_H_ */
int BackendId
Definition: backendid.h:21
unsigned int uint32
Definition: c.h:441
#define PGDLLIMPORT
Definition: c.h:1331
uint32 LocalTransactionId
Definition: c.h:589
unsigned char uint8
Definition: c.h:439
uint32 TransactionId
Definition: c.h:587
size_t Size
Definition: c.h:540
int XidStatus
Definition: clog.h:25
int LOCKMODE
Definition: lockdefs.h:26
int LOCKMASK
Definition: lockdefs.h:25
#define NUM_LOCK_PARTITIONS
Definition: lwlock.h:87
unsigned int Oid
Definition: postgres_ext.h:31
PGDLLIMPORT int IdleInTransactionSessionTimeout
Definition: proc.c:63
void ProcSendSignal(int pgprocno)
Definition: proc.c:1885
Size ProcGlobalShmemSize(void)
Definition: proc.c:102
bool IsWaitingForLock(void)
Definition: proc.c:682
PGDLLIMPORT int IdleSessionTimeout
Definition: proc.c:64
void InitAuxiliaryProcess(void)
Definition: proc.c:515
PGDLLIMPORT PROC_HDR * ProcGlobal
Definition: proc.c:80
#define FP_LOCK_SLOTS_PER_BACKEND
Definition: proc.h:77
int GetStartupBufferPinWaitBufId(void)
Definition: proc.c:645
PGPROC * ProcWakeup(PGPROC *proc, ProcWaitStatus waitStatus)
Definition: proc.c:1665
PGDLLIMPORT PGPROC * MyProc
Definition: proc.c:68
void ProcLockWakeup(LockMethod lockMethodTable, LOCK *lock)
Definition: proc.c:1702
struct PROC_HDR PROC_HDR
#define PGPROC_MAX_CACHED_SUBXIDS
Definition: proc.h:36
int ProcGlobalSemas(void)
Definition: proc.c:124
void ProcReleaseLocks(bool isCommit)
Definition: proc.c:775
void LockErrorCleanup(void)
Definition: proc.c:699
bool BecomeLockGroupMember(PGPROC *leader, int pid)
Definition: proc.c:1930
PGDLLIMPORT int StatementTimeout
Definition: proc.c:61
void BecomeLockGroupLeader(void)
Definition: proc.c:1900
PGDLLIMPORT int DeadlockTimeout
Definition: proc.c:60
PGPROC * AuxiliaryPidGetProc(int pid)
Definition: proc.c:968
PGDLLIMPORT int LockTimeout
Definition: proc.c:62
void InitProcess(void)
Definition: proc.c:301
void CheckDeadLockAlert(void)
Definition: proc.c:1847
void InitProcessPhase2(void)
Definition: proc.c:480
void InitProcGlobal(void)
Definition: proc.c:159
ProcWaitStatus ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable)
Definition: proc.c:1045
PGDLLIMPORT bool log_lock_waits
Definition: proc.c:65
ProcWaitStatus
Definition: proc.h:121
@ PROC_WAIT_STATUS_OK
Definition: proc.h:122
@ PROC_WAIT_STATUS_WAITING
Definition: proc.h:123
@ PROC_WAIT_STATUS_ERROR
Definition: proc.h:124
void ProcQueueInit(PROC_QUEUE *queue)
Definition: proc.c:1021
PGDLLIMPORT PGPROC * PreparedXactProcs
Definition: proc.c:82
struct XidCacheStatus XidCacheStatus
bool HaveNFreeProcs(int n)
Definition: proc.c:659
void SetStartupBufferPinWaitBufId(int bufid)
Definition: proc.c:633
void ProcWaitForSignal(uint32 wait_event_info)
Definition: proc.c:1873
Definition: lock.h:301
Definition: lwlock.h:32
Definition: latch.h:111
Definition: proc.h:160
PGPROC ** procgloballist
Definition: proc.h:163
LWLock fpInfoLock
Definition: proc.h:278
TransactionId xmin
Definition: proc.h:176
Oid fpRelId[FP_LOCK_SLOTS_PER_BACKEND]
Definition: proc.h:280
bool procArrayGroupMember
Definition: proc.h:254
LocalTransactionId lxid
Definition: proc.h:181
PROCLOCK * waitProcLock
Definition: proc.h:218
SHM_QUEUE links
Definition: proc.h:162
uint64 fpLockBits
Definition: proc.h:279
XLogRecPtr clogGroupMemberLsn
Definition: proc.h:274
pg_atomic_uint32 procArrayGroupNext
Definition: proc.h:256
uint8 lwWaitMode
Definition: proc.h:209
dlist_head lockGroupMembers
Definition: proc.h:290
int clogGroupMemberPage
Definition: proc.h:272
uint32 wait_event_info
Definition: proc.h:264
uint8 statusFlags
Definition: proc.h:227
bool recoveryConflictPending
Definition: proc.h:205
TransactionId clogGroupMemberXid
Definition: proc.h:269
Oid databaseId
Definition: proc.h:192
bool clogGroupMember
Definition: proc.h:267
pg_atomic_uint64 waitStart
Definition: proc.h:222
bool fpVXIDLock
Definition: proc.h:281
BackendId backendId
Definition: proc.h:191
int pid
Definition: proc.h:184
XLogRecPtr waitLSN
Definition: proc.h:237
bool isBackgroundWorker
Definition: proc.h:198
int syncRepState
Definition: proc.h:238
pg_atomic_uint32 clogGroupNext
Definition: proc.h:268
dlist_node lockGroupLink
Definition: proc.h:291
SHM_QUEUE syncRepLinks
Definition: proc.h:239
XidStatus clogGroupMemberXidStatus
Definition: proc.h:270
int pgxactoff
Definition: proc.h:186
XidCacheStatus subxidStatus
Definition: proc.h:248
LOCK * waitLock
Definition: proc.h:217
proclist_node lwWaitLink
Definition: proc.h:210
TransactionId xid
Definition: proc.h:171
LOCKMODE waitLockMode
Definition: proc.h:219
int pgprocno
Definition: proc.h:188
struct XidCache subxids
Definition: proc.h:250
bool lwWaiting
Definition: proc.h:208
int delayChkptFlags
Definition: proc.h:225
PGPROC * lockGroupLeader
Definition: proc.h:289
LocalTransactionId fpLocalTransactionId
Definition: proc.h:282
TransactionId procArrayGroupMemberXid
Definition: proc.h:262
LOCKMASK heldLocks
Definition: proc.h:220
PGSemaphore sem
Definition: proc.h:165
Oid roleId
Definition: proc.h:193
ProcWaitStatus waitStatus
Definition: proc.h:166
proclist_node cvWaitLink
Definition: proc.h:213
Oid tempNamespaceId
Definition: proc.h:195
SHM_QUEUE myProcLocks[NUM_LOCK_PARTITIONS]
Definition: proc.h:246
Latch procLatch
Definition: proc.h:168
Definition: lock.h:362
Definition: proc.h:354
uint8 * statusFlags
Definition: proc.h:371
XidCacheStatus * subxidStates
Definition: proc.h:365
PGPROC * walsenderFreeProcs
Definition: proc.h:382
Latch * walwriterLatch
Definition: proc.h:388
PGPROC * autovacFreeProcs
Definition: proc.h:378
PGPROC * bgworkerFreeProcs
Definition: proc.h:380
PGPROC * freeProcs
Definition: proc.h:376
int startupBufferPinWaitBufId
Definition: proc.h:394
PGPROC * allProcs
Definition: proc.h:356
pg_atomic_uint32 clogGroupFirst
Definition: proc.h:386
int spins_per_delay
Definition: proc.h:392
TransactionId * xids
Definition: proc.h:359
Latch * checkpointerLatch
Definition: proc.h:390
pg_atomic_uint32 procArrayGroupFirst
Definition: proc.h:384
uint32 allProcCount
Definition: proc.h:374
bool overflowed
Definition: proc.h:43
uint8 count
Definition: proc.h:41
Definition: proc.h:47
TransactionId xids[PGPROC_MAX_CACHED_SUBXIDS]
Definition: proc.h:48
uint64 XLogRecPtr
Definition: xlogdefs.h:21