Re: Concerns regarding code in pgstat_backend.c
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.
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:t53262psql -h localhost -U postgresBuilt from patchset v1 (message #1), July 28, 2026 at 10:41 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 t53262_1 https://github.com/hackorum-dev/postgres.gitIn a checkout you already have, add the fork once:
git remote add hackorum https://github.com/hackorum-dev/postgres.gitthen, for this patchset and every later one:
git fetch hackorum t53262_1 && git checkout t53262_1Patchset v1 (message #1) is on t53262_1
On Fri, Feb 06, 2026 at 07:11:07AM +0000, Ryo Matsumura (Fujitsu) wrote:
I found the code that is likely to cause bugs in the future. It's not currently a bug.
Should I have misunderstood, please feel free to disregard this email.
Because this is a clear thinko. pgstat_bestart_final() is always a
code path taken after pgstat_beinit() for auxiliary processes and the
rest of the world. I am pretty sure that my intention here was to
use the argument and not MyProcNumber in the function
pgstat_create_backend() because we rely on MyProcNumber to be defined
when the create routine is called, and that's what
pgstat_bestart_final() offers as guarantee, due to pgstat_beinit().
There is no bug currently, but let's clean that up in all the branches
anyway for clarity and any future back-patch. Hence, what do you think
about the attached?
--
Michael
Import Notes
Reply to msg id not found: TYCPR01MB11316AD8150C8F470319ACCAEE866A@TYCPR01MB11316.jpnprd01.prod.outlook.comReference msg id not found: TYCPR01MB11316AD8150C8F470319ACCAEE866A@TYCPR01MB11316.jpnprd01.prod.outlook.com
On Fri, Mar 06, 2026 at 07:34 AM UTC, Michael Paquier wrote:
There is no bug currently, but let's clean that up in all the branches
anyway for clarity and any future back-patch. Hence, what do you think
about the attached?
I think attached code causes no concern.
Best Regards
Ryo Matsumura
On Fri, Feb 06, 2026 at 09:02:46AM +0000, Ryo Matsumura (Fujitsu) wrote:
I think attached code causes no concern.
Fixed that while I had my mind on it. Thanks for the report.
--
Michael
Import Notes
Reply to msg id not found: TYCPR01MB113167CF70F19654D038F46DAE866A@TYCPR01MB11316.jpnprd01.prod.outlook.comReference msg id not found: TYCPR01MB11316AD8150C8F470319ACCAEE866A@TYCPR01MB11316.jpnprd01.prod.outlook.com