pgsql: pg_resetxlog: add option to set oldest xid & use by pg_upgrade

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: pg_resetxlog: add option to set oldest xid & use by pg_upgrade
Date: 2021-07-27 02:38:49
Message-ID: E1m8CzZ-0007cs-Tg@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

pg_resetxlog: add option to set oldest xid & use by pg_upgrade

Add pg_resetxlog -u option to set the oldest xid in pg_control.
Previously -x set this value be -2 billion less than the -x value.
However, this causes the server to immediately scan all relation's
relfrozenxid so it can advance pg_control's oldest xid to be inside the
autovacuum_freeze_max_age range, which is inefficient and might disrupt
diagnostic recovery. pg_upgrade will use this option to better create
the new cluster to match the old cluster.

Reported-by: Jason Harvey, Floris Van Nee

Discussion: https://postgr.es/m/20190615183759.GB239428@rfd.leadboat.com, 87da83168c644fd9aae38f546cc70295(at)opammb0562(dot)comp(dot)optiver(dot)com

Author: Bertrand Drouvot

Backpatch-through: 9.6

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/74cf7d46a91d601e0f8d957a7edbaeeb7df83efc

Modified Files
--------------
doc/src/sgml/ref/pg_resetwal.sgml | 20 +++++++++++
src/bin/pg_resetwal/pg_resetwal.c | 72 ++++++++++++++++++++++-----------------
src/bin/pg_upgrade/controldata.c | 17 ++++++++-
src/bin/pg_upgrade/pg_upgrade.c | 7 ++++
src/bin/pg_upgrade/pg_upgrade.h | 1 +
5 files changed, 85 insertions(+), 32 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2021-07-27 02:55:07 pgsql: doc: for various substring funcs, document if only first match
Previous Message Michael Paquier 2021-07-27 02:03:04 pgsql: Simplify matching pattern check in TAP tests of pg_receivewal