From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Make write of pgstats file durable at shutdown
Date: Wed, 17 Jul 2024 03:06:41 +0000
Message-ID: <E1sTv05-001ybS-4N@gemulon.postgresql.org> (raw)
Make write of pgstats file durable at shutdown
This switches the pgstats write code to use durable_rename() rather than
rename(). This ensures that the stats file's data is durable when the
statistics are written, which is something only happening at shutdown
now with the checkpointer doing the job.
This could cause the statistics to be lost even after PostgreSQL is shut
down, should a host failure happen, for example.
Suggested-by: Konstantin Knizhnik
Reviewed-by: Bertrand Drouvot
Discussion: https://postgr.es/m/ZpDQTZ0cAz0WEbh7@paquier.xyz
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/ec678692f6d0a8b05b86ca08e96b51e4063cba32
Modified Files
--------------
src/backend/utils/activity/pgstat.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Make write of pgstats file durable at shutdown
In-Reply-To: <E1sTv05-001ybS-4N@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox