Re: Add 64-bit XIDs into PostgreSQL 15

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Maxim Orlov <orlovmg(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>, Alexander Korotkov <aekorotkov(at)gmail(dot)com>, Teodor Sigaev <teodor(at)sigaev(dot)ru>, Nikita Glukhov <n(dot)gluhov(at)postgrespro(dot)ru>, Konstantin Knizhnik <knizhnik(at)garret(dot)ru>, Yura Sokolov <y(dot)sokolov(at)postgrespro(dot)ru>
Subject: Re: Add 64-bit XIDs into PostgreSQL 15
Date: 2022-01-15 06:39:25
Message-ID: 20220115063925.GS14051@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I tried to pg_upgrade from a v13 instance like:
time make check -C src/bin/pg_upgrade oldsrc=`pwd`/13 oldbindir=`pwd`/13/tmp_install/usr/local/pgsql/bin

I had compiled and installed v13 into `pwd`/13.

First, test.sh failed, because of an option in initdb which doesn't exist in
the old version: -x 21000000000

I patched test.sh so the option is used only the "new" version.

The tab_core_types table has an XID column, so pg_upgrade --check complains and
refuses to run. If I drop it, then pg_upgrade runs, but then fails like this:

|Files /home/pryzbyj/src/postgres/src/bin/pg_upgrade/tmp_check/new_xids.txt and /home/pryzbyj/src/postgres/src/bin/pg_upgrade/tmp_check/old_xids.txt differ
|See /home/pryzbyj/src/postgres/src/bin/pg_upgrade/tmp_check/xids.diff
|
|--- /home/pryzbyj/src/postgres/src/bin/pg_upgrade/tmp_check/new_xids.txt 2022-01-15 00:14:23.035294414 -0600
|+++ /home/pryzbyj/src/postgres/src/bin/pg_upgrade/tmp_check/old_xids.txt 2022-01-15 00:13:59.634945012 -0600
|@@ -1,5 +1,5 @@
| relfrozenxid | relminmxid
| --------------+------------
|- 3 | 3
|+ 15594 | 3
| (1 row)

Also, the patch needs to be rebased over Peter's vacuum changes.

Here's the changes I used for my test:

diff --git a/src/bin/pg_upgrade/test.sh b/src/bin/pg_upgrade/test.sh
index c6361e3c085..5eae42192b6 100644
--- a/src/bin/pg_upgrade/test.sh
+++ b/src/bin/pg_upgrade/test.sh
@@ -24,7 +24,8 @@ standard_initdb() {
# without increasing test runtime, run these tests with a custom setting.
# Also, specify "-A trust" explicitly to suppress initdb's warning.
# --allow-group-access and --wal-segsize have been added in v11.
- "$1" -N --wal-segsize 1 --allow-group-access -A trust -x 21000000000
+ "$@" -N --wal-segsize 1 --allow-group-access -A trust
+
if [ -n "$TEMP_CONFIG" -a -r "$TEMP_CONFIG" ]
then
cat "$TEMP_CONFIG" >> "$PGDATA/postgresql.conf"
@@ -237,7 +238,7 @@ fi

PGDATA="$BASE_PGDATA"

-standard_initdb 'initdb'
+standard_initdb 'initdb' -x 21000000000

pg_upgrade $PG_UPGRADE_OPTS --no-sync -d "${PGDATA}.old" -D "$PGDATA" -b "$oldbindir" -p "$PGPORT" -P "$PGPORT"

diff --git a/src/bin/pg_upgrade/upgrade_adapt.sql b/src/bin/pg_upgrade/upgrade_adapt.sql
index 27c4c7fd011..c5ce8bc95b2 100644
--- a/src/bin/pg_upgrade/upgrade_adapt.sql
+++ b/src/bin/pg_upgrade/upgrade_adapt.sql
@@ -89,3 +89,5 @@ DROP OPERATOR public.#%# (pg_catalog.int8, NONE);
DROP OPERATOR public.!=- (pg_catalog.int8, NONE);
DROP OPERATOR public(dot)#(at)%# (pg_catalog.int8, NONE);
\endif
+
+DROP TABLE IF EXISTS tab_core_types;

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey Borodin 2022-01-15 07:16:59 Re: MultiXact\SLRU buffers configuration
Previous Message houzj.fnst@fujitsu.com 2022-01-15 06:30:33 RE: row filtering for logical replication