Re: [BUG + PATCH] DSA pagemap out-of-bounds in make_new_segment odd-sized path - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [BUG + PATCH] DSA pagemap out-of-bounds in make_new_segment odd-sized path
Date
Msg-id aa5SuZezpUzXA6k_@paquier.xyz
Whole thread Raw
In response to Re: [BUG + PATCH] DSA pagemap out-of-bounds in make_new_segment odd-sized path  (Paul Bunn <paul.bunn@icloud.com>)
List pgsql-hackers
On Fri, Mar 06, 2026 at 08:22:27AM -0800, Paul Bunn wrote:
> ugh, the .out file was not updated. v4 fixes that.

I have looked at that, and found that the assumptions behind the
formulas could have a better documentation, information actually added
partially in the commit log of the first versions of the patch.
Having that in the comments of the code felt more adapted.

The test case was taking a long time to run, up to a couple of
seconds.  And it was much slower in the buildfarm.  The allocation
time stacks quickly once we aim for higher, and being able to test the
odd-sized case could come to 1901 and 6501 for the number of pages.
Hence I have slightly reworked the function, tweaking it with a
"start" and an "end" location, on top of the custom "step".

A last issue was with total_pages, shadow variable of a declaration
with the same name in the function make_new_segment().  This can be
switched to a PG_USED_FOR_ASSERTS_ONLY, with a different name.

And backpatched down to v14, with the test down to v17.  The test
required a slight tweak in v18 and v17.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: generic plans and "initial" pruning
Next
From: Japin Li
Date:
Subject: Re: Convert NOT IN sublinks to anti-joins when safe