Hi, On Fri, Jul 05, 2024 at 09:35:19AM +0900, Michael Paquier wrote: > On Thu, Jul 04, 2024 at 11:30:17AM +0000, Bertrand Drouvot wrote: > > > > /* > > * Reads in existing statistics file into the shared stats hash. > > > > This comment above pgstat_read_statsfile() is not correct, fixed stats > > are not going to the hash (was there before your patch though). > > Good catch. Let's adjust that separately.
Please find attached a patch to do so (attached as .txt to not perturb the cfbot). Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com
>From 67fdfa3eeef3e089a7b99b97f47f6c1e64b501cf Mon Sep 17 00:00:00 2001 From: Bertrand Drouvot <bertranddrouvot...@gmail.com> Date: Thu, 11 Jul 2024 12:26:05 +0000 Subject: [PATCH v1] Fix comment on top of pgstat_read_statsfile() The stats are read from the file and then loaded into the shared stats hash ( for non fixed amount stats) or into the fixed amount stats. Previous comment was mentioning only the shared stats hash case. --- src/backend/utils/activity/pgstat.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 100.0% src/backend/utils/activity/ diff --git a/src/backend/utils/activity/pgstat.c b/src/backend/utils/activity/pgstat.c index c0ec9e8195..a7b8ecc1b6 100644 --- a/src/backend/utils/activity/pgstat.c +++ b/src/backend/utils/activity/pgstat.c @@ -1495,10 +1495,11 @@ read_chunk(FILE *fpin, void *ptr, size_t len) #define read_chunk_s(fpin, ptr) read_chunk(fpin, ptr, sizeof(*ptr)) /* - * Reads in existing statistics file into the shared stats hash. + * Reads in existing statistics file into the shared stats hash (for non fixed + * amount stats) or into the fixed amount stats. * - * This function is called in the only process that is accessing the shared - * stats so locking is not required. + * This function is called in the only process that is accessing the stats + * so locking is not required. */ static void pgstat_read_statsfile(void) -- 2.34.1