PostgreSQL Source Code git master
|
#include "postgres.h"
#include "miscadmin.h"
#include "postmaster/autovacuum.h"
#include "postmaster/postmaster.h"
#include "replication/walsender.h"
#include "storage/pmsignal.h"
#include "storage/proc.h"
Go to the source code of this file.
Data Structures | |
struct | PMChildPool |
Typedefs | |
typedef struct PMChildPool | PMChildPool |
Functions | |
int | MaxLivePostmasterChildren (void) |
void | InitPostmasterChildSlots (void) |
PMChild * | AssignPostmasterChildSlot (BackendType btype) |
PMChild * | AllocDeadEndChild (void) |
bool | ReleasePostmasterChildSlot (PMChild *pmchild) |
PMChild * | FindPostmasterChildByPid (int pid) |
Variables | |
static PMChildPool | pmchild_pools [BACKEND_NUM_TYPES] |
NON_EXEC_STATIC int | num_pmchild_slots = 0 |
dlist_head | ActiveChildList |
typedef struct PMChildPool PMChildPool |
PMChild * AllocDeadEndChild | ( | void | ) |
Definition at line 207 of file pmchild.c.
References ActiveChildList, B_DEAD_END_BACKEND, PMChild::bgworker_notify, PMChild::bkend_type, PMChild::child_slot, DEBUG2, dlist_push_head(), PMChild::elem, elog, MCXT_ALLOC_NO_OOM, palloc_extended(), PMChild::pid, and PMChild::rw.
Referenced by BackendStartup().
PMChild * AssignPostmasterChildSlot | ( | BackendType | btype | ) |
Definition at line 161 of file pmchild.c.
References ActiveChildList, PMChild::bgworker_notify, PMChild::bkend_type, PMChild::child_slot, DEBUG2, dlist_container, dlist_is_empty(), dlist_pop_head_node(), dlist_push_head(), PMChild::elem, elog, ERROR, PMChildPool::first_slotno, PMChildPool::freelist, MarkPostmasterChildSlotAssigned(), PMChild::pid, pmchild_pools, PostmasterChildName(), PMChild::rw, PMChildPool::size, and size.
Referenced by BackendStartup(), StartBackgroundWorker(), StartChildProcess(), and StartSysLogger().
PMChild * FindPostmasterChildByPid | ( | int | pid | ) |
Definition at line 273 of file pmchild.c.
References ActiveChildList, dlist_iter::cur, dlist_container, dlist_foreach, and PMChild::pid.
Referenced by process_pm_child_exit().
void InitPostmasterChildSlots | ( | void | ) |
Definition at line 86 of file pmchild.c.
References ActiveChildList, Assert, autovacuum_worker_slots, B_ARCHIVER, B_AUTOVAC_LAUNCHER, B_AUTOVAC_WORKER, B_BACKEND, B_BG_WORKER, B_BG_WRITER, B_CHECKPOINTER, B_INVALID, B_LOGGER, B_SLOTSYNC_WORKER, B_STARTUP, B_WAL_RECEIVER, B_WAL_SUMMARIZER, B_WAL_WRITER, BACKEND_NUM_TYPES, PMChild::bgworker_notify, PMChild::bkend_type, PMChild::child_slot, dlist_init(), dlist_push_tail(), PMChildPool::first_slotno, i, j, max_wal_senders, max_worker_processes, MaxConnections, num_pmchild_slots, palloc(), PMChild::pid, pmchild_pools, PMChild::rw, PMChildPool::size, and size.
Referenced by BootstrapModeMain(), PostgresSingleUserMain(), and PostmasterMain().
int MaxLivePostmasterChildren | ( | void | ) |
Definition at line 70 of file pmchild.c.
References elog, ERROR, and num_pmchild_slots.
Referenced by PMSignalShmemInit(), and PMSignalShmemSize().
bool ReleasePostmasterChildSlot | ( | PMChild * | pmchild | ) |
Definition at line 235 of file pmchild.c.
References B_BACKEND, B_DEAD_END_BACKEND, B_WAL_SENDER, PMChild::bkend_type, PMChild::child_slot, DEBUG2, dlist_delete(), dlist_push_head(), PMChild::elem, elog, ERROR, PMChildPool::first_slotno, PMChildPool::freelist, MarkPostmasterChildSlotUnassigned(), pfree(), pmchild_pools, and PMChildPool::size.
Referenced by BackendStartup(), CleanupBackend(), process_pm_child_exit(), StartBackgroundWorker(), StartChildProcess(), and StartSysLogger().
dlist_head ActiveChildList |
Definition at line 60 of file pmchild.c.
Referenced by AllocDeadEndChild(), AssignPostmasterChildSlot(), CountChildren(), FindPostmasterChildByPid(), HandleChildCrash(), InitPostmasterChildSlots(), PostmasterMarkPIDForWorkerNotify(), and SignalChildren().
NON_EXEC_STATIC int num_pmchild_slots = 0 |
Definition at line 55 of file pmchild.c.
Referenced by InitPostmasterChildSlots(), and MaxLivePostmasterChildren().
|
static |
Definition at line 54 of file pmchild.c.
Referenced by AssignPostmasterChildSlot(), InitPostmasterChildSlots(), and ReleasePostmasterChildSlot().