bug in SignalSomeChildren - Mailing list pgsql-hackers

From Fujii Masao
Subject bug in SignalSomeChildren
Date
Msg-id AANLkTikhV9vJMsokP8A1Zt2k1Zi+GvBhR+iHs8O7gUau@mail.gmail.com
Whole thread Raw
Responses Re: bug in SignalSomeChildren  (Robert Haas <robertmhaas@gmail.com>)
Re: bug in SignalSomeChildren  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
Hi,

I found a bug which always prevents SignalSomeChildren with
BACKEND_TYPE_WALSND from sending a signal to walsender.

Though currently SignalSomeChildren with BACKEND_TYPE_WALSND
has not been called anywhere, it's not hard to believe that will
be called in the future. So we should apply the following change.

----------------------
diff --git a/src/backend/postmaster/postmaster.c
b/src/backend/postmaster/postmaster.c
index 6f934ee..2d86fb6 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -3162,7 +3162,8 @@ SignalSomeChildren(int signal, int target)
               if (bp->dead_end)                       continue;
-               if (!(target & BACKEND_TYPE_NORMAL) && !bp->is_autovacuum)
+               if (!(target & BACKEND_TYPE_NORMAL) && !bp->is_autovacuum &&
+                       !IsPostmasterChildWalSender(bp->child_slot))                       continue;               if
(!(target& BACKEND_TYPE_AUTOVAC) && bp->is_autovacuum)                       continue;
 
----------------------

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Getting "ERROR: no unpinned buffers available" on HEAD, should I investigate?
Next
From: Robert Haas
Date:
Subject: Re: pg_execute_from_file, patch v10