1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-14 02:22:38 +03:00

Add redo LSN to pgstats files

This is used in the startup process to check that the pgstats file we
are reading includes the redo LSN referring to the shutdown checkpoint
where it has been written.  The redo LSN in the pgstats file needs to
match with what the control file has.

This is intended to be used for an upcoming change that will extend the
write of the stats file to happen during checkpoints, rather than only
shutdown sequences.

Bump PGSTAT_FILE_FORMAT_ID.

Reviewed-by: Bertrand Drouvot
Discussion: https://postgr.es/m/Zp8o6_cl0KSgsnvS@paquier.xyz
This commit is contained in:
Michael Paquier
2024-08-02 01:57:28 +09:00
parent c27090bd60
commit b860848232
3 changed files with 36 additions and 12 deletions

View File

@@ -5652,7 +5652,7 @@ StartupXLOG(void)
if (didCrash)
pgstat_discard_stats();
else
pgstat_restore_stats();
pgstat_restore_stats(checkPoint.redo);
lastFullPageWrites = checkPoint.fullPageWrites;