From 71121450e8f42b21665ee9c8f70b701f7a16c801 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Mon, 26 Jul 2021 22:38:14 -0400 Subject: 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 --- doc/src/sgml/ref/pg_resetwal.sgml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/pg_resetwal.sgml b/doc/src/sgml/ref/pg_resetwal.sgml index defaf170dc6..89ddca47e90 100644 --- a/doc/src/sgml/ref/pg_resetwal.sgml +++ b/doc/src/sgml/ref/pg_resetwal.sgml @@ -247,6 +247,25 @@ PostgreSQL documentation + + + + + Manually set the oldest unfrozen transaction ID. + + + + A safe value can be determined by looking for the numerically smallest + file name in the directory pg_xact under the data directory + and then multiplying by 1048576 (0x100000). Note that the file names are in + hexadecimal. It is usually easiest to specify the option value in + hexadecimal too. For example, if 0007 is the smallest entry + in pg_xact, -u 0x700000 will work (five + trailing zeroes provide the proper multiplier). + + + + xid -- cgit v1.2.3