pgstat: Use correct lock level in pgstat_drop_all_entries().
Andres Freund <andres@anarazel.de>
pgstat: Use correct lock level in pgstat_drop_all_entries(). Previously we didn't, which lead to an assertion failure when resetting partially loaded statistics. This was encountered on the buildfarm, for as-of-yet unknown reasons. Ttighten up a validity check when reading the stats file, verifying 'E' signals the end of the file (rather than just stopping reading). That's then used in a test appending to the stats file that crashed before the fix in pgstat_drop_all_entries(). Reported by buildfarm animals mylodon and kestrel, via Tom Lane. Discussion: https://postgr.es/m/1656446.1650043715@sss.pgh.pa.us
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/activity/pgstat.c | modified | +4 −0 |
| src/backend/utils/activity/pgstat_shmem.c | modified | +1 −1 |
| src/test/recovery/t/029_stats_restart.pl | modified | +28 −2 |
Discussion
- Crash in new pgstats code 14 messages · 2022-04-15 → 2022-05-12