[PATCH] Add initial xid/mxid/mxoff to initdb

Started by Maxim Orlovover 4 years ago5 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

won't retrysuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t45916
psql -h localhost -U postgres

Built from patchset v2 (message #2), July 28, 2026 at 01:37 AM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t45916_2 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t45916_2 && git checkout t45916_2

Patchset v2 (message #2) is on t45916_2

Jump to latest
#1Maxim Orlov
orlovmg@gmail.com

Hi!

During work on 64-bit XID patch [1]/messages/by-id/CACG=ezZe1NQSCnfHOr78AtAZxJZeCvxrts0ygrxYwe=pyyjVWA@mail.gmail.com we found handy to have initdb options
to set initial xid/mxid/mxoff values to arbitrary non default values. It
helps test different scenarios: related to wraparound, pg_upgrade from
32-bit XID to 64-bit XID, etc.

We realize, this patch can be singled out as an independent patch from the
whole patchset in [1]/messages/by-id/CACG=ezZe1NQSCnfHOr78AtAZxJZeCvxrts0ygrxYwe=pyyjVWA@mail.gmail.com and be useful irrespective of 64-bit XID in cases of
testing of wraparound and so on.

In particular, we employed this patch to test recent changes in logical
replication of subxacts [2]/messages/by-id/d045f3c2-6cfb-06d3-5540-e63c320df8bc@enterprisedb.com and found no problems in it near the point of
publisher wraparound.

Please share your opinions and reviews are always welcome.

[1]: /messages/by-id/CACG=ezZe1NQSCnfHOr78AtAZxJZeCvxrts0ygrxYwe=pyyjVWA@mail.gmail.com
/messages/by-id/CACG=ezZe1NQSCnfHOr78AtAZxJZeCvxrts0ygrxYwe=pyyjVWA@mail.gmail.com
[2]: /messages/by-id/d045f3c2-6cfb-06d3-5540-e63c320df8bc@enterprisedb.com
/messages/by-id/d045f3c2-6cfb-06d3-5540-e63c320df8bc@enterprisedb.com

--
Best regards,
Maxim Orlov.

Attachments:

v1-0001-Add-initdb-option-to-initialize-cluster-with-non-.patchtext/x-patch; charset=US-ASCII; name=v1-0001-Add-initdb-option-to-initialize-cluster-with-non-.patchDownload+380-14
#2Maxim Orlov
orlovmg@gmail.com
In reply to: Maxim Orlov (#1)
Re: [PATCH] Add initial xid/mxid/mxoff to initdb

Hi!

CF bot says patch does not apply. Rebased.
Your reviews are very much welcome!

--
Best regards,
Maxim Orlov.

Attachments:

t45916_2
v2-0001-Add-initdb-option-to-initialize-cluster-with-non-.patchapplication/octet-stream; name=v2-0001-Add-initdb-option-to-initialize-cluster-with-non-.patchDownload+379-14
#3Peter Eisentraut
peter_e@gmx.net
In reply to: Maxim Orlov (#1)
Re: [PATCH] Add initial xid/mxid/mxoff to initdb

On 05.05.22 17:47, Maxim Orlov wrote:

During work on 64-bit XID patch [1] we found handy to have initdb
options to set initial xid/mxid/mxoff values to arbitrary non default
values. It helps test different scenarios: related to wraparound,
pg_upgrade from 32-bit XID to 64-bit XID, etc.

We realize, this patch can be singled out as an independent patch from
the whole patchset in [1] and be useful irrespective of 64-bit XID in
cases of testing of wraparound and so on.

In particular, we employed this patch to test recent changes in logical
replication of subxacts [2] and found no problems in it near the point
of publisher wraparound.

Just for completeness, over in the other thread the feedback was that
this functionality is better put into pg_resetwal.

#4Gregory Stark (as CFM)
stark.cfm@gmail.com
In reply to: Peter Eisentraut (#3)
Re: [PATCH] Add initial xid/mxid/mxoff to initdb

On Fri, 25 Nov 2022 at 07:22, Peter Eisentraut
<peter.eisentraut@enterprisedb.com> wrote:

Just for completeness, over in the other thread the feedback was that
this functionality is better put into pg_resetwal.

So is that other thread tracked in a different commitfest entry and
this one completely redundant? I'll mark it Rejected then?

--
Gregory Stark
As Commitfest Manager

#5Maxim Orlov
orlovmg@gmail.com
In reply to: Gregory Stark (as CFM) (#4)
Re: [PATCH] Add initial xid/mxid/mxoff to initdb

On Mon, 20 Mar 2023 at 22:31, Gregory Stark (as CFM) <stark.cfm@gmail.com>
wrote:

So is that other thread tracked in a different commitfest entry and
this one completely redundant? I'll mark it Rejected then?

Yep, it appears so.

--
Best regards,
Maxim Orlov.