Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/backend/postmaster/pmchild.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ InitPostmasterChildSlots(void)
* There can be only one of each of these running at a time. They each
* get their own pool of just one entry.
*/
pmchild_pools[B_SYSTEM_BG_WORKER].size = 1;
pmchild_pools[B_AUTOVAC_LAUNCHER].size = 1;
pmchild_pools[B_SLOTSYNC_WORKER].size = 1;
pmchild_pools[B_ARCHIVER].size = 1;
Expand Down Expand Up @@ -252,6 +251,14 @@ ReleasePostmasterChildSlot(PMChild *pmchild)
/* WAL senders start out as regular backends, and share the pool */
if (pmchild->bkend_type == B_WAL_SENDER)
pool = &pmchild_pools[B_BACKEND];

/*
* System background workers are allocated from the regular bgworker
* pool and retyped in do_start_bgworker(), so their slots must be
* returned to that pool.
*/
else if (pmchild->bkend_type == B_SYSTEM_BG_WORKER)
pool = &pmchild_pools[B_BG_WORKER];
else
pool = &pmchild_pools[pmchild->bkend_type];

Expand Down