PostgreSQL Source Code git master
Loading...
Searching...
No Matches
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-2026, 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/xlogdefs.h"
18#include "lib/ilist.h"
19#include "miscadmin.h"
20#include "storage/latch.h"
21#include "storage/lock.h"
22#include "storage/pg_sema.h"
24#include "storage/procnumber.h"
25#include "storage/spin.h"
26
27/* Avoid including clog.h here */
28typedef int XidStatus;
29
30/*
31 * Each backend advertises up to PGPROC_MAX_CACHED_SUBXIDS TransactionIds
32 * for non-aborted subtransactions of its current top transaction. These
33 * have to be treated as running XIDs by other backends.
34 *
35 * We also keep track of whether the cache overflowed (ie, the transaction has
36 * generated at least one subtransaction that didn't fit in the cache).
37 * If none of the caches have overflowed, we can assume that an XID that's not
38 * listed anywhere in the PGPROC array is not a running transaction. Else we
39 * have to look at pg_subtrans.
40 *
41 * See src/test/isolation/specs/subxid-overflow.spec if you change this.
42 */
43#define PGPROC_MAX_CACHED_SUBXIDS 64 /* XXX guessed-at value */
44
45typedef struct XidCacheStatus
46{
47 /* number of cached subxids, never more than PGPROC_MAX_CACHED_SUBXIDS */
49 /* has PGPROC->subxids overflowed */
52
57
58/*
59 * Flags for PGPROC->statusFlags and PROC_HDR->statusFlags[]
60 */
61#define PROC_IS_AUTOVACUUM 0x01 /* is it an autovac worker? */
62#define PROC_IN_VACUUM 0x02 /* currently running lazy vacuum */
63#define PROC_IN_SAFE_IC 0x04 /* currently running CREATE INDEX
64 * CONCURRENTLY or REINDEX
65 * CONCURRENTLY on non-expressional,
66 * non-partial index */
67#define PROC_VACUUM_FOR_WRAPAROUND 0x08 /* set by autovac only */
68#define PROC_IN_LOGICAL_DECODING 0x10 /* currently doing logical
69 * decoding outside xact */
70#define PROC_AFFECTS_ALL_HORIZONS 0x20 /* this proc's xmin must be
71 * included in vacuum horizons
72 * in all databases */
73
74/* flags reset at EOXact */
75#define PROC_VACUUM_STATE_MASK \
76 (PROC_IN_VACUUM | PROC_IN_SAFE_IC | PROC_VACUUM_FOR_WRAPAROUND)
77
78/*
79 * Xmin-related flags. Make sure any flags that affect how the process' Xmin
80 * value is interpreted by VACUUM are included here.
81 */
82#define PROC_XMIN_FLAGS (PROC_IN_VACUUM | PROC_IN_SAFE_IC)
83
84/*
85 * We allow a limited number of "weak" relation locks (AccessShareLock,
86 * RowShareLock, RowExclusiveLock) to be recorded in the PGPROC structure
87 * (or rather in shared memory referenced from PGPROC) rather than the main
88 * lock table. This eases contention on the lock manager LWLocks. See
89 * storage/lmgr/README for additional details.
90 */
92
93/*
94 * Define the maximum number of fast-path locking groups per backend.
95 * This must be a power-of-two value. The actual number of fast-path
96 * lock groups is calculated in InitializeFastPathLocks() based on
97 * max_locks_per_transaction. 1024 is an arbitrary upper limit (matching
98 * max_locks_per_transaction = 16k). Values over 1024 are unlikely to be
99 * beneficial as there are bottlenecks we'll hit way before that.
100 */
101#define FP_LOCK_GROUPS_PER_BACKEND_MAX 1024
102#define FP_LOCK_SLOTS_PER_GROUP 16 /* don't change */
103#define FastPathLockSlotsPerBackend() \
104 (FP_LOCK_SLOTS_PER_GROUP * FastPathLockGroupsPerBackend)
105
106/*
107 * Flags for PGPROC.delayChkptFlags
108 *
109 * These flags can be used to delay the start or completion of a checkpoint
110 * for short periods. A flag is in effect if the corresponding bit is set in
111 * the PGPROC of any backend.
112 *
113 * For our purposes here, a checkpoint has three phases: (1) determine the
114 * location to which the redo pointer will be moved, (2) write all the
115 * data durably to disk, and (3) WAL-log the checkpoint.
116 *
117 * Setting DELAY_CHKPT_START prevents the system from moving from phase 1
118 * to phase 2. This is useful when we are performing a WAL-logged modification
119 * of data that will be flushed to disk in phase 2. By setting this flag
120 * before writing WAL and clearing it after we've both written WAL and
121 * performed the corresponding modification, we ensure that if the WAL record
122 * is inserted prior to the new redo point, the corresponding data changes will
123 * also be flushed to disk before the checkpoint can complete. (In the
124 * extremely common case where the data being modified is in shared buffers
125 * and we acquire an exclusive content lock and MarkBufferDirty() on the
126 * relevant buffers before writing WAL, this mechanism is not needed, because
127 * phase 2 will block until we release the content lock and then flush the
128 * modified data to disk. See transam/README and SyncOneBuffer().)
129 *
130 * Setting DELAY_CHKPT_COMPLETE prevents the system from moving from phase 2
131 * to phase 3. This is useful if we are performing a WAL-logged operation that
132 * might invalidate buffers, such as relation truncation. In this case, we need
133 * to ensure that any buffers which were invalidated and thus not flushed by
134 * the checkpoint are actually destroyed on disk. Replay can cope with a file
135 * or block that doesn't exist, but not with a block that has the wrong
136 * contents.
137 *
138 * Setting DELAY_CHKPT_IN_COMMIT is similar to setting DELAY_CHKPT_START, but
139 * it explicitly indicates that the reason for delaying the checkpoint is due
140 * to a transaction being within a critical commit section. We need this new
141 * flag to ensure all the transactions that have acquired commit timestamp are
142 * finished before we allow the logical replication client to advance its xid
143 * which is used to hold back dead rows for conflict detection.
144 */
145#define DELAY_CHKPT_START (1<<0)
146#define DELAY_CHKPT_COMPLETE (1<<1)
147#define DELAY_CHKPT_IN_COMMIT (DELAY_CHKPT_START | 1<<2)
148
149typedef enum
150{
155
156/*
157 * Each backend has a PGPROC struct in shared memory. There is also a list of
158 * currently-unused PGPROC structs that will be reallocated to new backends.
159 *
160 * Note: twophase.c also sets up a dummy PGPROC struct for each currently
161 * prepared transaction. These PGPROCs appear in the ProcArray data structure
162 * so that the prepared transactions appear to be still running and are
163 * correctly shown as holding locks. A prepared transaction PGPROC can be
164 * distinguished from a real one at need by the fact that it has pid == 0.
165 * The semaphore and lock-activity fields in a prepared-xact PGPROC are unused,
166 * but its myProcLocks[] lists are valid.
167 *
168 * We allow many fields of this struct to be accessed without locks, such as
169 * delayChkptFlags and backendType. However, keep in mind that writing
170 * mirrored ones (see below) requires holding ProcArrayLock or XidGenLock in
171 * at least shared mode, so that pgxactoff does not change concurrently.
172 *
173 * Mirrored fields:
174 *
175 * Some fields in PGPROC (see "mirrored in ..." comment) are mirrored into an
176 * element of more densely packed ProcGlobal arrays. These arrays are indexed
177 * by PGPROC->pgxactoff. Both copies need to be maintained coherently.
179 * NB: The pgxactoff indexed value can *never* be accessed without holding
180 * locks.
181 *
182 * See PROC_HDR for details.
183 */
184typedef struct PGPROC
186 /*
187 * Align the struct at cache line boundaries. This is just for
188 * performance, to avoid false sharing.
189 */
190 alignas(PG_CACHE_LINE_SIZE)
191 dlist_head *procgloballist; /* procglobal list that owns this PGPROC */
192 dlist_node freeProcsLink; /* link in procgloballist, when in recycled
193 * state */
194
195 /************************************************************************
196 * Backend identity
197 ************************************************************************/
199 /*
200 * These fields that don't change after backend startup, or only very
201 * rarely
202 */
203 int pid; /* Backend's process ID; 0 if prepared xact */
204 BackendType backendType; /* what kind of process is this? */
205
206 /* These fields are zero while a backend is still starting up: */
207 Oid databaseId; /* OID of database this backend is using */
208 Oid roleId; /* OID of role using this backend */
209
210 Oid tempNamespaceId; /* OID of temp schema this backend is
211 * using */
212
213 int pgxactoff; /* offset into various ProcGlobal->arrays with
214 * data mirrored from this PGPROC */
215
216 uint8 statusFlags; /* this backend's status flags, see PROC_*
217 * above. mirrored in
218 * ProcGlobal->statusFlags[pgxactoff] */
219
220 /************************************************************************
221 * Transactions and snapshots
222 ************************************************************************/
223
224 /*
225 * Currently running top-level transaction's virtual xid. Together these
226 * form a VirtualTransactionId, but we don't use that struct because this
227 * is not atomically assignable as whole, and we want to enforce code to
228 * consider both parts separately. See comments at VirtualTransactionId.
229 */
230 struct
232 ProcNumber procNumber; /* For regular backends, equal to
233 * GetNumberFromPGProc(proc). For prepared
234 * xacts, ID of the original backend that
235 * processed the transaction. For unused
236 * PGPROC entries, INVALID_PROC_NUMBER. */
237 LocalTransactionId lxid; /* local id of top-level transaction
238 * currently * being executed by this
239 * proc, if running; else
240 * InvalidLocalTransactionId */
241 } vxid;
243 TransactionId xid; /* id of top-level transaction currently being
244 * executed by this proc, if running and XID
245 * is assigned; else InvalidTransactionId.
246 * mirrored in ProcGlobal->xids[pgxactoff] */
248 TransactionId xmin; /* minimal running XID as it was when we were
249 * starting our xact, excluding LAZY VACUUM:
250 * vacuum must not remove tuples deleted by
251 * xid >= xmin ! */
252
253 XidCacheStatus subxidStatus; /* mirrored with
254 * ProcGlobal->subxidStates[i] */
255 struct XidCache subxids; /* cache for subtransaction XIDs */
257
258 /************************************************************************
259 * Inter-process signaling
260 ************************************************************************/
261
262 Latch procLatch; /* generic latch for process */
263
264 PGSemaphore sem; /* ONE semaphore to sleep on */
265
266 int delayChkptFlags; /* for DELAY_CHKPT_* flags */
267
268 /*
269 * While in hot standby mode, shows that a conflict signal has been sent
270 * for the current transaction. Set/cleared while holding ProcArrayLock,
271 * though not required. Accessed without lock, if needed.
272 *
273 * This is a bitmask; each bit corresponds to a RecoveryConflictReason
274 * enum value.
275 */
277
278 /************************************************************************
279 * LWLock waiting
280 ************************************************************************/
281
282 /*
283 * Info about LWLock the process is currently waiting for, if any.
285 * This is currently used both for lwlocks and buffer content locks, which
286 * is acceptable, although not pretty, because a backend can't wait for
287 * both types of locks at the same time.
288 */
289 uint8 lwWaiting; /* see LWLockWaitState */
290 uint8 lwWaitMode; /* lwlock mode being waited for */
291 proclist_node lwWaitLink; /* position in LW lock wait list */
292
293 /* Support for condition variables. */
294 proclist_node cvWaitLink; /* position in CV wait list */
295
296 /************************************************************************
297 * Lock manager data
298 ************************************************************************/
300 /*
301 * Support for lock groups. Use LockHashPartitionLockByProc on the group
302 * leader to get the LWLock protecting these fields.
303 */
304 PGPROC *lockGroupLeader; /* lock group leader, if I'm a member */
305 dlist_head lockGroupMembers; /* list of members, if I'm a leader */
306 dlist_node lockGroupLink; /* my member link, if I'm a member */
308 /* Info about lock the process is currently waiting for, if any. */
309 /* waitLock and waitProcLock are NULL if not currently waiting. */
310 LOCK *waitLock; /* Lock object we're sleeping on ... */
311 dlist_node waitLink; /* position in waitLock->waitProcs queue */
312 PROCLOCK *waitProcLock; /* Per-holder info for awaited lock */
313 LOCKMODE waitLockMode; /* type of lock we're waiting for */
314 LOCKMASK heldLocks; /* bitmask for lock types already held on this
315 * lock object by this backend */
316
317 pg_atomic_uint64 waitStart; /* time at which wait for lock acquisition
318 * started */
319
322 /*
323 * All PROCLOCK objects for locks held or awaited by this backend are
324 * linked into one of these lists, according to the partition number of
325 * their lock.
326 */
329 /*-- recording fast-path locks taken by this backend. --*/
330 LWLock fpInfoLock; /* protects per-backend fast-path state */
331 uint64 *fpLockBits; /* lock modes held for each fast-path slot */
332 Oid *fpRelId; /* slots for rel oids */
333 bool fpVXIDLock; /* are we holding a fast-path VXID lock? */
334 LocalTransactionId fpLocalTransactionId; /* lxid for fast-path VXID
335 * lock */
336
337 /************************************************************************
338 * Synchronous replication waiting
339 ************************************************************************/
340
341 /*
342 * Info to allow us to wait for synchronous replication, if needed.
343 * waitLSN is InvalidXLogRecPtr if not waiting; set only by user backend.
344 * syncRepState must not be touched except by owning process or WALSender.
345 * syncRepLinks used only while holding SyncRepLock.
346 */
347 XLogRecPtr waitLSN; /* waiting for this LSN or higher */
348 int syncRepState; /* wait state for sync rep */
349 dlist_node syncRepLinks; /* list link if process is in syncrep queue */
351 /************************************************************************
352 * Support for group XID clearing
353 ************************************************************************/
354
355 /* true, if member of ProcArray group waiting for XID clear */
357 /* next ProcArray group member waiting for XID clear */
359
360 /*
361 * latest transaction id among the transaction's main XID and
362 * subtransactions
363 */
366 /************************************************************************
367 * Support for group transaction status update
368 ************************************************************************/
370 bool clogGroupMember; /* true, if member of clog group */
371 pg_atomic_uint32 clogGroupNext; /* next clog group member */
372 TransactionId clogGroupMemberXid; /* transaction id of clog group member */
373 XidStatus clogGroupMemberXidStatus; /* transaction status of clog
374 * group member */
375 int64 clogGroupMemberPage; /* clog page corresponding to
376 * transaction id of clog group member */
377 XLogRecPtr clogGroupMemberLsn; /* WAL location of commit record for clog
378 * group member */
379
380 /************************************************************************
381 * Status reporting
382 ************************************************************************/
383
384 uint32 wait_event_info; /* proc's wait information */
385}
386PGPROC;
387
389
390/*
391 * There is one ProcGlobal struct for the whole database cluster.
392 *
393 * Adding/Removing an entry into the procarray requires holding *both*
394 * ProcArrayLock and XidGenLock in exclusive mode (in that order). Both are
395 * needed because the dense arrays (see below) are accessed from
396 * GetNewTransactionId() and GetSnapshotData(), and we don't want to add
397 * further contention by both using the same lock. Adding/Removing a procarray
398 * entry is much less frequent.
399 *
400 * Some fields in PGPROC are mirrored into more densely packed arrays (e.g.
401 * xids), with one entry for each backend. These arrays only contain entries
402 * for PGPROCs that have been added to the shared array with ProcArrayAdd()
403 * (in contrast to PGPROC array which has unused PGPROCs interspersed).
404 *
405 * The dense arrays are indexed by PGPROC->pgxactoff. Any concurrent
406 * ProcArrayAdd() / ProcArrayRemove() can lead to pgxactoff of a procarray
407 * member to change. Therefore it is only safe to use PGPROC->pgxactoff to
408 * access the dense array while holding either ProcArrayLock or XidGenLock.
409 *
410 * As long as a PGPROC is in the procarray, the mirrored values need to be
411 * maintained in both places in a coherent manner.
412 *
413 * The denser separate arrays are beneficial for three main reasons: First, to
414 * allow for as tight loops accessing the data as possible. Second, to prevent
415 * updates of frequently changing data (e.g. xmin) from invalidating
416 * cachelines also containing less frequently changing data (e.g. xid,
417 * statusFlags). Third to condense frequently accessed data into as few
418 * cachelines as possible.
419 *
420 * There are two main reasons to have the data mirrored between these dense
421 * arrays and PGPROC. First, as explained above, a PGPROC's array entries can
422 * only be accessed with either ProcArrayLock or XidGenLock held, whereas the
423 * PGPROC entries do not require that (obviously there may still be locking
424 * requirements around the individual field, separate from the concerns
425 * here). That is particularly important for a backend to efficiently checks
426 * it own values, which it often can safely do without locking. Second, the
427 * PGPROC fields allow to avoid unnecessary accesses and modification to the
428 * dense arrays. A backend's own PGPROC is more likely to be in a local cache,
429 * whereas the cachelines for the dense array will be modified by other
430 * backends (often removing it from the cache for other cores/sockets). At
431 * commit/abort time a check of the PGPROC value can avoid accessing/dirtying
432 * the corresponding array value.
433 *
434 * Basically it makes sense to access the PGPROC variable when checking a
435 * single backend's data, especially when already looking at the PGPROC for
436 * other reasons already. It makes sense to look at the "dense" arrays if we
437 * need to look at many / most entries, because we then benefit from the
438 * reduced indirection and better cross-process cache-ability.
439 *
440 * When entering a PGPROC for 2PC transactions with ProcArrayAdd(), the data
441 * in the dense arrays is initialized from the PGPROC while it already holds
442 * ProcArrayLock.
443 */
444typedef struct PROC_HDR
445{
446 /* Array of PGPROC structures (not including dummies for prepared txns) */
448
449 /* Array mirroring PGPROC.xid for each PGPROC currently in the procarray */
451
452 /*
453 * Array mirroring PGPROC.subxidStatus for each PGPROC currently in the
454 * procarray.
455 */
457
458 /*
459 * Array mirroring PGPROC.statusFlags for each PGPROC currently in the
460 * procarray.
461 */
463
464 /* Length of allProcs array */
466
467 /*
468 * This spinlock protects the below freelists of PGPROC structures. We
469 * cannot use an LWLock because the LWLock manager depends on already
470 * having a PGPROC and a wait semaphore! But these structures are touched
471 * relatively infrequently (only at backend startup or shutdown) and not
472 * for very long, so a spinlock is okay.
473 */
476 /* Head of list of free PGPROC structures */
478 /* Head of list of autovacuum & special worker free PGPROC structures */
480 /* Head of list of bgworker free PGPROC structures */
482 /* Head of list of walsender free PGPROC structures */
484
485 /* First pgproc waiting for group XID clear */
487 /* First pgproc waiting for group transaction status update */
490 /*
491 * Current slot numbers of some auxiliary processes. There can be only one
492 * of each of these running at a time.
493 */
496
497 /* Current shared estimate of appropriate spins_per_delay value */
498 int spins_per_delay;
499 /* Buffer id of the buffer that Startup process waits for pin on, or -1 */
501} PROC_HDR;
502
506
507/*
508 * Accessors for getting PGPROC given a ProcNumber and vice versa.
509 */
510#define GetPGProcByNumber(n) (&ProcGlobal->allProcs[(n)])
511#define GetNumberFromPGProc(proc) ((proc) - &ProcGlobal->allProcs[0])
512
513/*
514 * We set aside some extra PGPROC structures for "special worker" processes,
515 * which are full-fledged backends (they can run transactions)
516 * but are unique animals that there's never more than one of.
517 * Currently there are two such processes: the autovacuum launcher
518 * and the slotsync worker.
519 */
520#define NUM_SPECIAL_WORKER_PROCS 2
521
522/*
523 * We set aside some extra PGPROC structures for auxiliary processes,
524 * ie things that aren't full-fledged backends (they cannot run transactions
525 * or take heavyweight locks) but need shmem access.
527 * Background writer, checkpointer, WAL writer, WAL summarizer, and archiver
528 * run during normal operation. Startup process and WAL receiver also consume
529 * 2 slots, but WAL writer is launched only after startup has exited, so we
530 * only need 6 slots.
531 */
532#define MAX_IO_WORKERS 32
533#define NUM_AUXILIARY_PROCS (6 + MAX_IO_WORKERS)
534
535#define FIRST_PREPARED_XACT_PROC_NUMBER (MaxBackends + NUM_AUXILIARY_PROCS)
536
537/* configurable options */
540extern PGDLLIMPORT int LockTimeout;
544extern PGDLLIMPORT bool log_lock_waits;
545
546#ifdef EXEC_BACKEND
548#endif
549
550
551/*
552 * Function Prototypes
553 */
554extern int ProcGlobalSemas(void);
555extern void InitProcess(void);
556extern void InitProcessPhase2(void);
557extern void InitAuxiliaryProcess(void);
558
559extern void SetStartupBufferPinWaitBufId(int bufid);
560extern int GetStartupBufferPinWaitBufId(void);
561
562extern bool HaveNFreeProcs(int n, int *nfree);
563extern void ProcReleaseLocks(bool isCommit);
564
568extern void ProcWakeup(PGPROC *proc, ProcWaitStatus waitStatus);
570extern void CheckDeadLockAlert(void);
571extern void LockErrorCleanup(void);
575 int *lockHoldersNum);
576
577extern void ProcWaitForSignal(uint32 wait_event_info);
578extern void ProcSendSignal(ProcNumber procNumber);
579
580extern PGPROC *AuxiliaryPidGetProc(int pid);
581
582extern void BecomeLockGroupLeader(void);
583extern bool BecomeLockGroupMember(PGPROC *leader, int pid);
584
585#endif /* _PROC_H_ */
#define PGDLLIMPORT
Definition c.h:1421
uint8_t uint8
Definition c.h:622
int64_t int64
Definition c.h:621
uint64_t uint64
Definition c.h:625
uint32_t uint32
Definition c.h:624
uint32 LocalTransactionId
Definition c.h:738
uint32 TransactionId
Definition c.h:736
int LOCKMODE
Definition lockdefs.h:26
int LOCKMASK
Definition lockdefs.h:25
#define NUM_LOCK_PARTITIONS
Definition lwlock.h:87
BackendType
Definition miscadmin.h:350
#define PG_CACHE_LINE_SIZE
unsigned int Oid
static int fb(int x)
ProcWaitStatus JoinWaitQueue(LOCALLOCK *locallock, LockMethod lockMethodTable, bool dontWait)
Definition proc.c:1146
void ProcSendSignal(ProcNumber procNumber)
Definition proc.c:2027
PGDLLIMPORT int IdleInTransactionSessionTimeout
Definition proc.c:65
void ProcWakeup(PGPROC *proc, ProcWaitStatus waitStatus)
Definition proc.c:1748
PGDLLIMPORT int IdleSessionTimeout
Definition proc.c:67
bool HaveNFreeProcs(int n, int *nfree)
Definition proc.c:787
void InitAuxiliaryProcess(void)
Definition proc.c:618
void GetLockHoldersAndWaiters(LOCALLOCK *locallock, StringInfo lock_holders_sbuf, StringInfo lock_waiters_sbuf, int *lockHoldersNum)
Definition proc.c:1941
PGDLLIMPORT PROC_HDR * ProcGlobal
Definition proc.c:74
int XidStatus
Definition proc.h:28
int GetStartupBufferPinWaitBufId(void)
Definition proc.c:771
ProcWaitStatus ProcSleep(LOCALLOCK *locallock)
Definition proc.c:1315
PGDLLIMPORT PGPROC * MyProc
Definition proc.c:71
void ProcLockWakeup(LockMethod lockMethodTable, LOCK *lock)
Definition proc.c:1776
#define PGPROC_MAX_CACHED_SUBXIDS
Definition proc.h:43
int ProcGlobalSemas(void)
Definition proc.c:130
void ProcReleaseLocks(bool isCommit)
Definition proc.c:896
void LockErrorCleanup(void)
Definition proc.c:818
bool BecomeLockGroupMember(PGPROC *leader, int pid)
Definition proc.c:2072
PGDLLIMPORT int StatementTimeout
Definition proc.c:63
void BecomeLockGroupLeader(void)
Definition proc.c:2042
PGDLLIMPORT int DeadlockTimeout
Definition proc.c:62
PGDLLIMPORT int LockTimeout
Definition proc.c:64
void InitProcess(void)
Definition proc.c:392
void CheckDeadLockAlert(void)
Definition proc.c:1914
void InitProcessPhase2(void)
Definition proc.c:583
PGDLLIMPORT bool log_lock_waits
Definition proc.c:68
ProcWaitStatus
Definition proc.h:144
@ PROC_WAIT_STATUS_OK
Definition proc.h:145
@ PROC_WAIT_STATUS_WAITING
Definition proc.h:146
@ PROC_WAIT_STATUS_ERROR
Definition proc.h:147
PGDLLIMPORT PGPROC * PreparedXactProcs
Definition proc.c:78
PGDLLIMPORT int TransactionTimeout
Definition proc.c:66
PGPROC * AuxiliaryPidGetProc(int pid)
Definition proc.c:1097
void SetStartupBufferPinWaitBufId(int bufid)
Definition proc.c:759
void ProcWaitForSignal(uint32 wait_event_info)
Definition proc.c:2015
PGDLLIMPORT int FastPathLockGroupsPerBackend
Definition lock.c:205
int ProcNumber
Definition procnumber.h:24
NON_EXEC_STATIC PGPROC * AuxiliaryProcs
Definition proc.c:77
Definition lock.h:140
Definition latch.h:116
Definition proc.h:179
LWLock fpInfoLock
Definition proc.h:324
TransactionId xmin
Definition proc.h:242
bool procArrayGroupMember
Definition proc.h:350
LocalTransactionId lxid
Definition proc.h:231
PROCLOCK * waitProcLock
Definition proc.h:306
dlist_node freeProcsLink
Definition proc.h:186
XLogRecPtr clogGroupMemberLsn
Definition proc.h:371
pg_atomic_uint32 procArrayGroupNext
Definition proc.h:352
uint8 lwWaitMode
Definition proc.h:284
dlist_head lockGroupMembers
Definition proc.h:299
uint32 wait_event_info
Definition proc.h:378
dlist_head * procgloballist
Definition proc.h:185
Oid * fpRelId
Definition proc.h:326
BackendType backendType
Definition proc.h:198
uint8 statusFlags
Definition proc.h:210
TransactionId clogGroupMemberXid
Definition proc.h:366
Oid databaseId
Definition proc.h:201
int64 clogGroupMemberPage
Definition proc.h:369
bool clogGroupMember
Definition proc.h:364
uint64 * fpLockBits
Definition proc.h:325
pg_atomic_uint64 waitStart
Definition proc.h:311
bool fpVXIDLock
Definition proc.h:327
ProcNumber procNumber
Definition proc.h:226
int pid
Definition proc.h:197
XLogRecPtr waitLSN
Definition proc.h:341
dlist_node syncRepLinks
Definition proc.h:343
struct PGPROC::@136 vxid
int syncRepState
Definition proc.h:342
pg_atomic_uint32 clogGroupNext
Definition proc.h:365
dlist_node lockGroupLink
Definition proc.h:300
XidStatus clogGroupMemberXidStatus
Definition proc.h:367
int pgxactoff
Definition proc.h:207
XidCacheStatus subxidStatus
Definition proc.h:247
LOCK * waitLock
Definition proc.h:304
proclist_node lwWaitLink
Definition proc.h:285
TransactionId xid
Definition proc.h:237
LOCKMODE waitLockMode
Definition proc.h:307
struct XidCache subxids
Definition proc.h:249
int delayChkptFlags
Definition proc.h:260
dlist_node waitLink
Definition proc.h:305
PGPROC * lockGroupLeader
Definition proc.h:298
pg_atomic_uint32 pendingRecoveryConflicts
Definition proc.h:270
LocalTransactionId fpLocalTransactionId
Definition proc.h:328
TransactionId procArrayGroupMemberXid
Definition proc.h:358
LOCKMASK heldLocks
Definition proc.h:308
PGSemaphore sem
Definition proc.h:258
dlist_head myProcLocks[NUM_LOCK_PARTITIONS]
Definition proc.h:321
Oid roleId
Definition proc.h:202
ProcWaitStatus waitStatus
Definition proc.h:314
proclist_node cvWaitLink
Definition proc.h:288
Oid tempNamespaceId
Definition proc.h:204
uint8 lwWaiting
Definition proc.h:283
Latch procLatch
Definition proc.h:256
uint8 * statusFlags
Definition proc.h:456
XidCacheStatus * subxidStates
Definition proc.h:450
dlist_head autovacFreeProcs
Definition proc.h:473
dlist_head freeProcs
Definition proc.h:471
ProcNumber checkpointerProc
Definition proc.h:489
slock_t freeProcsLock
Definition proc.h:468
int startupBufferPinWaitBufId
Definition proc.h:494
PGPROC * allProcs
Definition proc.h:441
pg_atomic_uint32 clogGroupFirst
Definition proc.h:482
int spins_per_delay
Definition proc.h:492
TransactionId * xids
Definition proc.h:444
dlist_head walsenderFreeProcs
Definition proc.h:477
dlist_head bgworkerFreeProcs
Definition proc.h:475
ProcNumber walwriterProc
Definition proc.h:488
pg_atomic_uint32 procArrayGroupFirst
Definition proc.h:480
uint32 allProcCount
Definition proc.h:459
bool overflowed
Definition proc.h:50
uint8 count
Definition proc.h:48
TransactionId xids[PGPROC_MAX_CACHED_SUBXIDS]
Definition proc.h:55
uint64 XLogRecPtr
Definition xlogdefs.h:21