From: Noah Misch <noah@leadboat.com>
To: Alexander Korotkov <aekorotkov@gmail.com>
Cc: Maxim Orlov <orlovmg@gmail.com>
Cc: Aleksander Alekseev <aleksander@timescale.com>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Japin Li <japinli@hotmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Pavel Borisov <pashkin.elfe@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Subject: Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)
Date: Tue, 25 Jun 2024 17:27:47 -0700
Message-ID: <20240626002747.dc.nmisch@google.com> (raw)
In-Reply-To: <CAPpHfduwDL29rGb_ONKwAsmq6bfMRgP+y+QkZJFUWuv2rDpb4g@mail.gmail.com>
References: <4dd273c5-f594-1c04-3710-5811e62b18db@iki.fi>
<CACG=ezY5+P5D1UwbEC3YmP-jxiDcB21TjB11FHQT5QCb_qtugg@mail.gmail.com>
<CAJ7c6TPYPJ8YVD-GxjW-+Xdqodtoje+rVgQXUxdL2Kx+j5oG8w@mail.gmail.com>
<b5f6c6ac-37da-b92d-a482-9171710d1a11@iki.fi>
<CAJ7c6TPmzoPgj-4zdf+UqdV4GcoZag+=KTLpSJ3RHp5pYSxfZg@mail.gmail.com>
<CAPpHfdtQhm1BXT9SL5jp1iOg=pN=A9pR98kwBCOQX4Pg=CY6mA@mail.gmail.com>
<CAJ7c6TOUMe6izUX7r9t6zhK-X7La0fMgA4ru9BMniKAEv7pZKQ@mail.gmail.com>
<CACG=ezbtS=nLBS6fedHxAjkBPRN-hyuHQ+su1VUtxWDsavDTYA@mail.gmail.com>
<CACG=ezaOGAAmzqKjq=EDyqA6jNVtNFVvTc6-HstEy43swRqTog@mail.gmail.com>
<CAPpHfduwDL29rGb_ONKwAsmq6bfMRgP+y+QkZJFUWuv2rDpb4g@mail.gmail.com>
On Mon, Nov 27, 2023 at 01:43:26AM +0200, Alexander Korotkov wrote:
> v61 looks good to me. I'm going to push it as long as there are no objections.
This yielded commit 4ed8f09 "Index SLRUs by 64-bit integers rather than by
32-bit integers" and left some expressions coercing SLRU page numbers to int.
Two sources:
grep -i 'int\b.*page' $(git grep -l SimpleLruInit)
make && touch $(git grep -l SimpleLruInit) && make PROFILE=-Wconversion 2>&1 | less -p '.int. from .int64. may alter its value'
(Not every match needs to change.)
> --- a/src/include/access/slru.h
> +++ b/src/include/access/slru.h
> @@ -127,7 +127,15 @@ typedef struct SlruCtlData
> * the behavior of this callback has no functional implications.) Use
> * SlruPagePrecedesUnitTests() in SLRUs meeting its criteria.
> */
> - bool (*PagePrecedes) (int, int);
> + bool (*PagePrecedes) (int64, int64);
> +
> + /*
> + * If true, use long segment filenames formed from lower 48 bits of the
> + * segment number, e.g. pg_xact/000000001234. Otherwise, use short
> + * filenames formed from lower 16 bits of the segment number e.g.
> + * pg_xact/1234.
> + */
> + bool long_segment_names;
SlruFileName() makes 15-character (60-bit) file names. Where does the 48-bit
limit arise? How does the SlruFileName() comment about a 24-bit limit for
short names relate this comment's 16-bit limit?
nm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: noah@leadboat.com, aekorotkov@gmail.com, orlovmg@gmail.com, aleksander@timescale.com, pgsql-hackers@lists.postgresql.org, hlinnaka@iki.fi, japinli@hotmail.com, andres@anarazel.de, michael@paquier.xyz, pashkin.elfe@gmail.com, peter.eisentraut@enterprisedb.com
Subject: Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)
In-Reply-To: <20240626002747.dc.nmisch@google.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox