Skip to content

Commit 1c44e35

Browse files
author
Heikki Linnakangas
committed
Fix returning bgworkers-turned-walsenders to freelist
1 parent 09794be commit 1c44e35

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/postmaster/pmchild.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ ReleasePostmasterChildSlot(PMChild *pmchild)
258258
* WalSender, so make sure we release the child back to the right
259259
* pool.
260260
*/
261-
if (pmchild->pid < pool->first_slotno &&
262-
pmchild->pid >= pool->first_slotno + pool->size)
261+
if (pmchild->child_slot >= pmchild_pools[B_BG_WORKER].first_slotno &&
262+
pmchild->child_slot < pmchild_pools[B_BG_WORKER].first_slotno + pmchild_pools[B_BG_WORKER].size)
263263
{
264264
pool = &pmchild_pools[B_BG_WORKER];
265265
}

0 commit comments

Comments
 (0)