From: | Andres Freund <andres(at)anarazel(dot)de> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: pgstat: Acquire lock when reading variable-numbered stats |
Date: | 2022-08-23 03:20:16 |
Message-ID: | E1oQKSd-000mm0-1f@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
pgstat: Acquire lock when reading variable-numbered stats
Somewhere during the development of the patch acquiring a lock during read
access to variable-numbered stats got lost. The missing lock acquisition won't
cause corruption, but can lead to reading torn values when accessing
stats. Add the missing lock acquisitions.
Reported-by: Greg Stark <stark(at)mit(dot)edu>
Reviewed-by: "Drouvot, Bertrand" <bdrouvot(at)amazon(dot)com>
Reviewed-by: Andres Freund <andres(at)anarazel(dot)de>
Author: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAM-w4HMYkM_DkYhWtUGV+qE_rrBxKOzOF0+5faozxO3vXrc9wA@mail.gmail.com
Backpatch: 15-
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/cd063344fb801a90a40923a5b8aefe4eb8d80762
Modified Files
--------------
src/backend/utils/activity/pgstat.c | 9 +++++++++
src/backend/utils/activity/pgstat_shmem.c | 16 ++++++++++++++++
src/include/utils/pgstat_internal.h | 1 +
3 files changed, 26 insertions(+)
From | Date | Subject | |
---|---|---|---|
Next Message | Andres Freund | 2022-08-23 03:30:52 | pgsql: Add BackendType for standalone backends |
Previous Message | John Naylor | 2022-08-23 02:58:49 | Re: pgsql: Refer to replication origin roident as "ID" in user facing messa |