Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15) - Mailing list pgsql-hackers

From Maxim Orlov
Subject Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)
Date
Msg-id CACG=ezZsCaAEPJKra_cbvV9_2YG5HpBBFuSDM11qPEOwShS73g@mail.gmail.com
Whole thread Raw
In response to Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)  (Andrey Borodin <amborodin86@gmail.com>)
List pgsql-hackers
Do I get it right that the proposed v51 patchset only changes the SLRU
filenames and type of pageno representation? Is SLRU wraparound still
exactly there after 0xFFFFFFFF byte?
After applying the whole patch set, SLRU will become 64–bit without a wraparound. Thus, no wraparound
should be there.

0001 - should make SLRU internally 64–bit, no effects from "outside"
0002 - should make SLRU callers 64–bit, SLRU segment files naming are changed
0003 - make upgrade from previous versions feasible
 
Also, I do not understand what is the reason for splitting 1st and 2nd
steps. Certainly, there must be some logic behind it, but I just can't
grasp it...
As we did discuss somewhere in the beginning of the discussion, we try to make every commit as independent as possible.
Thus, it is much easier to review and commit. I see no problem to meld these commits into one, if consensus will be reached.
 
And the purpose of the 3rd step with pg_upgrade changes is a complete
mystery for me. Please excuse my incompetence in the topic, but maybe
some commit message or comments would help. What kind of xact segments
conversion we do? Why is it only necessary for xacts, but not other
SLRUs?
The purpose of the third patch is to make upgrade feasible. Since we've change pg_xact files naming,
Postgres could not read status of "old" transactions from "old" pg_xact files. So, we have to convert those files.
The major problem here is that we must handle possible segment wraparound (in "old" cluster).  The whole idea
for an upgrade is to read SLRU pages for pg_xact one by one and write it in a "new" filename.

Maybe, It's just a little bit complicated, since the algorithm is intended to deal with different SLRU pages per segment
in "new" and "old" clusters. But, on the other hand, it is already created in original patch set of 64–bit XIDs and will be useful
in the future. AFAICS, arguably, any variant of 64–bit XIDs should lead to increase of an amount of SLRU pages per segment.

And as for other SLRUs, they cannot survive pg_upgrade mostly by the fact, that cluster must be stopped upon upgrade.
Thus, no conversion needed.

--
Best regards,
Maxim Orlov.

pgsql-hackers by date:

Previous
From: Richard Guo
Date:
Subject: Re: Allow DISTINCT to use Incremental Sort
Next
From: Aleksander Alekseev
Date:
Subject: Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)