From: | Michael Paquier <michael(at)paquier(dot)xyz> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Revert "Add redo LSN to pgstats files" |
Date: | 2025-03-16 23:36:15 |
Message-ID: | E1ttxWh-002pvA-0i@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Revert "Add redo LSN to pgstats files"
This reverts commit b860848232aa, that was added as a prerequisite for
the support of pgstats data flush across checkpoints, linking a pgstats
file to a specific checkpoint redo LSN.
As reported, this is proving to be currently problematic when going
through a pg_upgrade, that does direct manipulations of the control file
in the new cluster. The LSN stored in the pgstats file is not able to
cope with any changes done in the control file by pg_upgrade yet,
causing the pgstats file to be discarded when starting the new cluster
after overriding its redo LSN (one is a `pg_resetwal -l` where the new
cluster's start LSN is bumped by a hardcoded value of 8 segments, see
copy_xact_xlog_xid).
The least painful path going forward is likely going to be a refactor of
the pgstats code so as it is possible to read and write some of its data
with some routines in src/common/, so as pg_upgrade or pg_resetwal are
able to update its data. The main point is that we are going to need a
LSN in the stats file should we make it written at checkpoint time and
not only as part of a shutdown sequence. It is too late to dive into
these details for v18, so let's revert the change, and let's try to
figure out all the details in the next release cycle. The pgstats file
is currently only written as part of a shutdown sequence, and its
contents are still lost on crash, same as older releases.
Bump PGSTAT_FILE_FORMAT_ID.
Reported-by: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Discussion: https://postgr.es/m/2563883.1741826489@sss.pgh.pa.us
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/5721e5453ebc59360b6756fe72d7499c4a02177c
Modified Files
--------------
src/backend/access/transam/xlog.c | 2 +-
src/backend/utils/activity/pgstat.c | 41 ++++++++-----------------------------
src/include/pgstat.h | 5 ++---
3 files changed, 12 insertions(+), 36 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2025-03-17 03:43:34 | pgsql: Apply more consistent style for command options in TAP tests |
Previous Message | Tom Lane | 2025-03-16 22:08:34 | pgsql: pg_dump, pg_dumpall, pg_restore: Add --no-policies option. |