Re: Add 64-bit XIDs into PostgreSQL 15

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: "Finnerty, Jim" <jfinnert(at)amazon(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Maxim Orlov <orlovmg(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, Magnus Hagander <magnus(at)hagander(dot)net>, Michael Paquier <michael(at)paquier(dot)xyz>
Subject: Re: Add 64-bit XIDs into PostgreSQL 15
Date: 2022-08-26 20:04:46
Message-ID: 20220826200446.GK2342@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 05, 2022 at 06:12:26PM -0600, Justin Pryzby wrote:
> On Wed, Jan 05, 2022 at 06:51:37PM -0500, Bruce Momjian wrote:
> > On Tue, Jan 4, 2022 at 10:22:50PM +0000, Finnerty, Jim wrote:
> > > I'm concerned about the maintainability impact of having 2 new
> > > on-disk page formats. It's already complex enough with XIDs and
> > > multixact-XIDs.
> > >
> > > If the lack of space for the two epochs in the special data area is
> > > a problem only in an upgrade scenario, why not resolve the problem
> > > before completing the upgrade process like a kind of post-process
> > > pg_repack operation that converts all "double xmax" pages to
> > > the "double-epoch" page format? i.e. maybe the "double xmax"
> > > representation is needed as an intermediate representation during
> > > upgrade, but after upgrade completes successfully there are no pages
> > > with the "double-xmax" representation. This would eliminate a whole
> > > class of coding errors and would make the code dealing with 64-bit
> > > XIDs simpler and more maintainable.
> >
> > Well, yes, we could do this, and it would avoid the complexity of having
> > to support two XID representations, but we would need to accept that
> > fast pg_upgrade would be impossible in such cases, since every page
> > would need to be checked and potentially updated.
> >
> > You might try to do this while the server is first started and running
> > queries, but I think we found out from the online checkpoint patch that
>
> I think you meant the online checksum patch. Which this reminded me of, too.

I wondered whether anyone had considered using relation forks to maintain state
of these long, transitional processes.

Either a whole new fork, or additional bits in the visibility map, which has
page-level bits.

There'd still need to be a flag somewhere indicating whether
checksums/xid64s/etc were enabled cluster-wide. The VM/fork bits would need to
be checked while the cluster was being re-processed online. This would add
some overhead. After the cluster had reached its target state, the flag could
be set, and the VM bits would no longer need to be checked.

--
Justin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2022-08-26 20:07:32 Re: Strip -mmacosx-version-min options from plperl build
Previous Message Tom Lane 2022-08-26 20:00:31 Re: Strip -mmacosx-version-min options from plperl build