pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pg_resetxlog:  add option to set oldest xid & use by pg_upgrade
Date: Tue, 27 Jul 2021 02:38:49 +0000
Message-ID: <E1m8CzZ-0007cw-UR@gemulon.postgresql.org> (raw)

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@opammb0562.comp.optiver.com

Author: Bertrand Drouvot

Backpatch-through: 9.6

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0a5e708e2bd87adb0779d7c8758e5743cc1c0adf

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(-)



view thread (7+ messages)  latest in thread

Message-ID: <E1m8CzZ-0007cw-UR@gemulon.postgresql.org>
Permalink:  ../E1m8CzZ-0007cw-UR@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1m8CzZ-0007cw-UR@gemulon.postgresql.org

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: bruce@momjian.us
  Subject: Re: pgsql: pg_resetxlog:  add option to set oldest xid & use by pg_upgrade
  In-Reply-To: <E1m8CzZ-0007cw-UR@gemulon.postgresql.org>
  References: <E1m8CzZ-0007cw-UR@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