Skip to content

Commit 497749b

Browse files
hlinnakatristan957
authored andcommitted
Treat walproposer like walsenders in postmaster.
This keeps the walproposer processes alive at shutdown, until after the shutdown checkpoint has been written. That gives the walproposers a chance to stream it to the safekeepers.
1 parent 3be798e commit 497749b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/backend/postmaster/postmaster.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4136,7 +4136,8 @@ SignalSomeChildren(int signal, int target)
41364136
* Assign bkend_type for any recently announced WAL Sender
41374137
* processes.
41384138
*/
4139-
if (bp->bkend_type == BACKEND_TYPE_NORMAL &&
4139+
/* Neon: Also allow walproposer background worker to be treated like a WAL sender, so that it's shut down last */
4140+
if ((bp->bkend_type == BACKEND_TYPE_NORMAL || BACKEND_TYPE_BGWORKER) &&
41404141
IsPostmasterChildWalSender(bp->child_slot))
41414142
bp->bkend_type = BACKEND_TYPE_WALSND;
41424143

@@ -5416,7 +5417,8 @@ CountChildren(int target)
54165417
* Assign bkend_type for any recently announced WAL Sender
54175418
* processes.
54185419
*/
5419-
if (bp->bkend_type == BACKEND_TYPE_NORMAL &&
5420+
/* Neon: Also allow walproposer background worker to be treated like a WAL sender, so that it's shut down last */
5421+
if ((bp->bkend_type == BACKEND_TYPE_NORMAL || BACKEND_TYPE_BGWORKER) &&
54205422
IsPostmasterChildWalSender(bp->child_slot))
54215423
bp->bkend_type = BACKEND_TYPE_WALSND;
54225424

0 commit comments

Comments
 (0)