Inconsistent usage of BACKEND_* symbols

Started by Kyotaro Horiguchialmost 7 years ago2 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

won't retrysuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t41292
psql -h localhost -U postgres

Built from patchset v1 (message #1), July 28, 2026 at 03:39 AM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t41292_1 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t41292_1 && git checkout t41292_1

Patchset v1 (message #1) is on t41292_1

Jump to latest
#1Kyotaro Horiguchi
horikyota.ntt@gmail.com

Hello.

While I looked around shutdown sequence, pmdie() uses
"BACKEND_TYPE_AUTOVAC | BACKEND_TYPE_BGWORKER" for sending signal
and PostmasterStateMachine counts them using
BACKEND_TYPE_WORKER. It is the only usage of the combined one. It
seems to me just a leftover of da07a1e856.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachments:

t41292_1
Use_combined_backend_type_macros.patchtext/x-patch; charset=us-asciiDownload+3-4
#2Michael Paquier
michael@paquier.xyz
In reply to: Kyotaro Horiguchi (#1)
Re: Inconsistent usage of BACKEND_* symbols

On Mon, Sep 30, 2019 at 04:39:59PM +0900, Kyotaro Horiguchi wrote:

@@ -2740,8 +2740,8 @@ pmdie(SIGNAL_ARGS)
{
/* autovac workers are told to shut down immediately */
/* and bgworkers too; does this need tweaking? */
-            SignalSomeChildren(SIGTERM,
-                               BACKEND_TYPE_AUTOVAC | BACKEND_TYPE_BGWORKER);
+            SignalSomeChildren(SIGTERM, BACKEND_TYPE_WORKER);
+

For this one the comment would be inconsistent with the flags listed.

/* and the autovac launcher too */
if (AutoVacPID != 0)
signal_child(AutoVacPID, SIGTERM);
@@ -2821,8 +2821,7 @@ pmdie(SIGNAL_ARGS)
(errmsg("aborting any active transactions")));
/* shut down all backends and workers */
SignalSomeChildren(SIGTERM,
-                               BACKEND_TYPE_NORMAL | BACKEND_TYPE_AUTOVAC |
-                               BACKEND_TYPE_BGWORKER);
+                               BACKEND_TYPE_NORMAL | BACKEND_TYPE_WORKER);

Okay for this one.
--
Michael