Re: Flush pgstats file during checkpoints
Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Tomas Vondra <tomas.vondra@enterprisedb.com>, Konstantin Knizhnik <knizhnik@garret.ru>, Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-07-12T13:01:19Z
Lists: pgsql-hackers
Hi, On Fri, Jul 12, 2024 at 12:10:26PM +0000, Bertrand Drouvot wrote: > Need to spend more time and thoughts on 0002+. I think there is a corner case, say: 1. shutdown checkpoint at LSN1 2. startup->reads the stat file (contains LSN1)->all good->read stat file and remove it 3. crash (no checkpoint occured between 2. and 3.) 4. startup (last checkpoint is still LSN1)->no stat file (as removed in 2.) In that case we start with empty stats. Instead of removing the stat file, should we keep it around until the first call to pgstat_write_statsfile()? Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com
Commits
-
Add redo LSN to pgstats files
- b860848232aa 18.0 landed
-
Add more debugging information when failing to read pgstats files
- ca1ba50fcb6f 18.0 landed
-
Make write of pgstats file durable at shutdown
- ec678692f6d0 18.0 landed
-
Add assertion in pgstat_write_statsfile() about processes allowed
- 734c057a8935 18.0 landed