signal-some-children.patch
application/octet-stream
Filename: signal-some-children.patch
Type: application/octet-stream
Part: 0
Message:
Re: bug in SignalSomeChildren
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
| File | + | − |
|---|---|---|
| src/backend/postmaster/postmaster.c | 8 | 6 |
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 2b12b17..6263ba5 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -3147,15 +3147,17 @@ SignalSomeChildren(int signal, int target)
for (curr = DLGetHead(BackendList); curr; curr = DLGetSucc(curr))
{
Backend *bp = (Backend *) DLE_VAL(curr);
+ int child;
if (bp->dead_end)
continue;
- if (!(target & BACKEND_TYPE_NORMAL) && !bp->is_autovacuum)
- continue;
- if (!(target & BACKEND_TYPE_AUTOVAC) && bp->is_autovacuum)
- continue;
- if (!(target & BACKEND_TYPE_WALSND) &&
- IsPostmasterChildWalSender(bp->child_slot))
+ if (IsPostmasterChildWalSender(bp->child_slot))
+ child = BACKEND_TYPE_WALSND;
+ else if (bp->is_autovacuum)
+ child = BACKEND_TYPE_AUTOVAC;
+ else
+ child = BACKEND_TYPE_NORMAL;
+ if (!(target & child))
continue;
ereport(DEBUG4,