public inbox for [email protected]
help / color / mirror / Atom feedpgsql: Fix use of proc number in pgstat_create_backend()
2+ messages / 1 participants
[nested] [flat]
* pgsql: Fix use of proc number in pgstat_create_backend()
@ 2026-02-06 10:57 Michael Paquier <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Michael Paquier @ 2026-02-06 10:57 UTC (permalink / raw)
To: [email protected]
Fix use of proc number in pgstat_create_backend()
This routine's internals directly used MyProcNumber to choose which
object ID to assign for the hash key of a backend's stats entry, while
the value to use is given as input argument of the function.
The original intention was to pass MyProcNumber as an argument of
pgstat_create_backend() when called in pgstat_bestart_final(),
pgstat_beinit() ensuring that MyProcNumber has been set, not use it
directly in the function. This commit addresses this inconsistency by
using the procnum given by the caller of pgstat_create_backend(), not
MyProcNumber.
This issue is not a cause of bugs currently. However, let's keep the
code in sync across all the branches where this code exists, as it could
matter in a future backpatch.
Oversight in 4feba03d8b92.
Reported-by: Ryo Matsumura <[email protected]>
Discussion: https://postgr.es/m/TYCPR01MB11316AD8150C8F470319ACCAEE866A@TYCPR01MB11316.jpnprd01.prod.outlook.com
Backpatch-through: 18
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/072c8421359730149f4eaf861ce55aa78968ba9d
Modified Files
--------------
src/backend/utils/activity/pgstat_backend.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Fix use of proc number in pgstat_create_backend()
@ 2026-02-06 10:57 Michael Paquier <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Michael Paquier @ 2026-02-06 10:57 UTC (permalink / raw)
To: [email protected]
Fix use of proc number in pgstat_create_backend()
This routine's internals directly used MyProcNumber to choose which
object ID to assign for the hash key of a backend's stats entry, while
the value to use is given as input argument of the function.
The original intention was to pass MyProcNumber as an argument of
pgstat_create_backend() when called in pgstat_bestart_final(),
pgstat_beinit() ensuring that MyProcNumber has been set, not use it
directly in the function. This commit addresses this inconsistency by
using the procnum given by the caller of pgstat_create_backend(), not
MyProcNumber.
This issue is not a cause of bugs currently. However, let's keep the
code in sync across all the branches where this code exists, as it could
matter in a future backpatch.
Oversight in 4feba03d8b92.
Reported-by: Ryo Matsumura <[email protected]>
Discussion: https://postgr.es/m/TYCPR01MB11316AD8150C8F470319ACCAEE866A@TYCPR01MB11316.jpnprd01.prod.outlook.com
Backpatch-through: 18
Branch
------
REL_18_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/e679d0f0b6729d0e97510dd4ab6a793700d6d66a
Modified Files
--------------
src/backend/utils/activity/pgstat_backend.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2026-02-06 10:57 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-02-06 10:57 pgsql: Fix use of proc number in pgstat_create_backend() Michael Paquier <[email protected]>
2026-02-06 10:57 pgsql: Fix use of proc number in pgstat_create_backend() Michael Paquier <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox