#include "postgres.h"
#include "miscadmin.h"
#include "pg_trace.h"
#include "pgstat.h"
#include "storage/lmgr.h"
#include "storage/proc.h"
#include "storage/procnumber.h"
#include "utils/memutils.h"
Go to the source code of this file.
Definition at line 220 of file deadlock.c.
References Assert(), blocking_autovacuum_proc, dclist_count(), dclist_init(), dclist_push_tail(), DeadLockCheckRecurse(), DS_BLOCKED_BY_AUTOVACUUM, DS_HARD_DEADLOCK, DS_NO_DEADLOCK, DS_SOFT_DEADLOCK, elog, FATAL, FindLockCycle(), GetLocksMethodTable(), i, j, links, WAIT_ORDER::lock, nCurConstraints, nPossibleConstraints, WAIT_ORDER::nProcs, nWaitOrders, possibleConstraints, ProcLockWakeup(), WAIT_ORDER::procs, waitOrders, and LOCK::waitProcs.
Referenced by CheckDeadLock().
Definition at line 312 of file deadlock.c.
References curConstraints, DeadLockCheckRecurse(), elog, FATAL, i, MaxBackends, maxCurConstraints, maxPossibleConstraints, nCurConstraints, nPossibleConstraints, possibleConstraints, and TestConfiguration().
Referenced by DeadLockCheck(), and DeadLockCheckRecurse().
Definition at line 1075 of file deadlock.c.
References _, appendBinaryStringInfo(), appendStringInfo(), appendStringInfoChar(), StringInfoData::data, deadlockDetails, DescribeLockTag(), ereport, errcode(), ERRCODE_T_R_DEADLOCK_DETECTED, errdetail_internal(), errdetail_log(), errhint(), errmsg(), ERROR, GetLockmodeName(), i, initStringInfo(), StringInfoData::len, DEADLOCK_INFO::lockmode, DEADLOCK_INFO::locktag, LOCKTAG::locktag_lockmethodid, nDeadlockDetails, pgstat_get_backend_current_activity(), pgstat_report_deadlock(), DEADLOCK_INFO::pid, and resetStringInfo().
Referenced by LockAcquireExtended().
Definition at line 790 of file deadlock.c.
References Assert(), dclist_count(), i, j, EDGE::lock, WAIT_ORDER::lock, MaxBackends, WAIT_ORDER::nProcs, nWaitOrders, WAIT_ORDER::procs, TopoSort(), waitOrderProcs, waitOrders, and LOCK::waitProcs.
Referenced by TestConfiguration().
Definition at line 446 of file deadlock.c.
References FindLockCycleRecurse(), nDeadlockDetails, and nVisitedProcs.
Referenced by DeadLockCheck(), and TestConfiguration().
Definition at line 457 of file deadlock.c.
References Assert(), dlist_iter::cur, dlist_container, dlist_foreach, FindLockCycleRecurseMember(), i, PGPROC::links, PGPROC::lockGroupLeader, PGPROC::lockGroupMembers, MaxBackends, nDeadlockDetails, dlist_node::next, nVisitedProcs, visitedProcs, and PGPROC::waitLock.
Referenced by FindLockCycle(), and FindLockCycleRecurseMember().
Definition at line 536 of file deadlock.c.
References Assert(), EDGE::blocker, blocking_autovacuum_proc, LockMethodData::conflictTab, dlist_iter::cur, dclist_foreach, deadlockDetails, dlist_container, dlist_foreach, FindLockCycleRecurse(), GetLocksMethodTable(), PROCLOCK::holdMask, i, links, EDGE::lock, LOCK_LOCKTAG, LOCKBIT_ON, PGPROC::lockGroupLeader, DEADLOCK_INFO::lockmode, DEADLOCK_INFO::locktag, LOCKTAG_RELATION_EXTEND, MaxBackends, MyProc, PROCLOCKTAG::myProc, WAIT_ORDER::nProcs, LockMethodData::numLockModes, nWaitOrders, DEADLOCK_INFO::pid, PGPROC::pid, PROC_IS_AUTOVACUUM, LOCK::procLocks, WAIT_ORDER::procs, PGPROC::statusFlags, LOCK::tag, PROCLOCK::tag, EDGE::waiter, PGPROC::waitLock, PGPROC::waitLockMode, waitOrders, and LOCK::waitProcs.
Referenced by FindLockCycleRecurse().
Definition at line 290 of file deadlock.c.
References blocking_autovacuum_proc.
Referenced by ProcSleep().
Definition at line 144 of file deadlock.c.
References afterConstraints, beforeConstraints, curConstraints, deadlockDetails, MAX_BACKENDS_BITS, MaxBackends, maxCurConstraints, maxPossibleConstraints, MemoryContextSwitchTo(), palloc(), possibleConstraints, StaticAssertStmt, TopMemoryContext, topoProcs, visitedProcs, waitOrderProcs, and waitOrders.
Referenced by InitProcess().
Definition at line 1147 of file deadlock.c.
References deadlockDetails, DEADLOCK_INFO::lockmode, DEADLOCK_INFO::locktag, nDeadlockDetails, DEADLOCK_INFO::pid, PGPROC::pid, LOCK::tag, PGPROC::waitLock, and PGPROC::waitLockMode.
Referenced by JoinWaitQueue().
Definition at line 378 of file deadlock.c.
References curConstraints, ExpandConstraints(), FindLockCycle(), i, MaxBackends, maxPossibleConstraints, nCurConstraints, nPossibleConstraints, and possibleConstraints.
Referenced by DeadLockCheckRecurse().
Definition at line 862 of file deadlock.c.
References afterConstraints, Assert(), beforeConstraints, EDGE::blocker, dlist_iter::cur, dclist_count(), dclist_foreach, dlist_container, i, j, EDGE::link, links, PGPROC::lockGroupLeader, MemSet, EDGE::pred, topoProcs, EDGE::waiter, PGPROC::waitLock, and LOCK::waitProcs.
Referenced by ExpandConstraints().
Definition at line 109 of file deadlock.c.
Referenced by InitDeadLockChecking(), and TopoSort().
Definition at line 108 of file deadlock.c.
Referenced by InitDeadLockChecking(), and TopoSort().
Definition at line 129 of file deadlock.c.
Referenced by DeadLockCheck(), FindLockCycleRecurseMember(), and GetBlockingAutoVacuumPgproc().
Definition at line 117 of file deadlock.c.
Referenced by DeadLockCheckRecurse(), InitDeadLockChecking(), and TestConfiguration().
Definition at line 125 of file deadlock.c.
Referenced by DeadLockReport(), FindLockCycleRecurseMember(), InitDeadLockChecking(), and RememberSimpleDeadLock().
Definition at line 119 of file deadlock.c.
Referenced by DeadLockCheckRecurse(), and InitDeadLockChecking().
Definition at line 124 of file deadlock.c.
Referenced by DeadLockCheckRecurse(), InitDeadLockChecking(), and TestConfiguration().
Definition at line 118 of file deadlock.c.
Referenced by DeadLockCheck(), DeadLockCheckRecurse(), and TestConfiguration().
Definition at line 126 of file deadlock.c.
Referenced by DeadLockReport(), FindLockCycle(), FindLockCycleRecurse(), and RememberSimpleDeadLock().
Definition at line 123 of file deadlock.c.
Referenced by DeadLockCheck(), DeadLockCheckRecurse(), and TestConfiguration().
Definition at line 104 of file deadlock.c.
Referenced by FindLockCycle(), and FindLockCycleRecurse().
Definition at line 113 of file deadlock.c.
Referenced by DeadLockCheck(), ExpandConstraints(), and FindLockCycleRecurseMember().
Definition at line 122 of file deadlock.c.
Referenced by DeadLockCheck(), DeadLockCheckRecurse(), InitDeadLockChecking(), and TestConfiguration().
Definition at line 107 of file deadlock.c.
Referenced by InitDeadLockChecking(), and TopoSort().
Definition at line 103 of file deadlock.c.
Referenced by FindLockCycleRecurse(), and InitDeadLockChecking().
Definition at line 114 of file deadlock.c.
Referenced by ExpandConstraints(), and InitDeadLockChecking().
Definition at line 112 of file deadlock.c.
Referenced by DeadLockCheck(), ExpandConstraints(), FindLockCycleRecurseMember(), and InitDeadLockChecking().