pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Change logtape/tuplestore code to use int64 for block numbers
Date: Fri, 17 Nov 2023 02:23:38 +0000
Message-ID: <E1r3oWA-005oas-0B@gemulon.postgresql.org> (raw)

Change logtape/tuplestore code to use int64 for block numbers

The code previously relied on "long" as type to track block numbers,
which would be 4 bytes in all Windows builds or any 32-bit builds.  This
limited the code to be able to handle up to 16TB of data with the
default block size of 8kB, like during a CLUSTER.  This code now relies
on a more portable int64, which should be more than enough for at least
the next 20 years to come.

This issue has been reported back in 2017, but nothing was done about it
back then, so here we go now.

Reported-by: Peter Geoghegan
Reviewed-by: Heikki Linnakangas
Discussion: https://postgr.es/m/CAH2-WznCscXnWmnj=STC0aSa7QG+BRedDnZsP=Jo_R9GUZvUrg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b1e5c9fa9ac4399895bf312398c5d441baba0c3b

Modified Files
--------------
src/backend/storage/file/buffile.c |  10 +--
src/backend/utils/sort/logtape.c   | 126 ++++++++++++++++++-------------------
src/backend/utils/sort/tuplesort.c |  12 ++--
src/include/storage/buffile.h      |   4 +-
src/include/utils/logtape.h        |   8 +--
5 files changed, 80 insertions(+), 80 deletions(-)



Message-ID: <E1r3oWA-005oas-0B@gemulon.postgresql.org>
Permalink:  ../E1r3oWA-005oas-0B@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1r3oWA-005oas-0B@gemulon.postgresql.org

 · 

reply

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-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Change logtape/tuplestore code to use int64 for block numbers
  In-Reply-To: <E1r3oWA-005oas-0B@gemulon.postgresql.org>

* 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