Re: Fix an incorrect assertion condition in mdwritev(). - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Fix an incorrect assertion condition in mdwritev().
Date
Msg-id Zl5BD8u-kMgaTf-Y@paquier.xyz
Whole thread Raw
In response to Re: Fix an incorrect assertion condition in mdwritev().  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Fix an incorrect assertion condition in mdwritev().
List pgsql-hackers
On Sun, May 26, 2024 at 12:08:46AM -0400, Tom Lane wrote:
> After a few minutes' thought, how about:
>
>     Assert((uint64) blocknum + (uint64) nblocks <= (uint64) mdnblocks(reln, forknum));
>
> This'd stop being helpful if we ever widen BlockNumber to 64 bits,
> but I think that's unlikely.  (Partitioning seems like a better answer
> for giant tables.)

No idea if this will happen or not, but that's not the only area where
we are going to need a native uint128 implementation to control the
overflows with uint64.

What you are suggesting is good enough for me, so I've applied on HEAD
a version using that.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: Proposal: Document ABI Compatibility
Next
From: Andres Freund
Date:
Subject: Re: Fix an incorrect assertion condition in mdwritev().