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