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