Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)

From: Melanie Plageman <melanieplageman(at)gmail(dot)com>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Robert Haas <robertmhaas(at)gmail(dot)com>, Andrey Borodin <x4mmm(at)yandex-team(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Kirill Reshke <reshkekirill(at)gmail(dot)com>
Subject: Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)
Date: 2025-12-16 16:07:17
Message-ID: CAAKRu_bHpHthLdBrvLGhJsTLLe6zkPk5Q9pnBLrOdObUBZiwDg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 16, 2025 at 7:18 AM Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:
>
> You are not modifying deadoffsets in prune_freeze_setup(), but you are
> assigning its address to a pointer variable that is not const-qualified,
> and so it could be used to modify it later on.
>
> A caller to prune_freeze_setup() that sees the signature const
> PruneFreezeResult *presult could pass a pointer to a PruneFreezeResult
> object that is notionally in read-only memory. But through the
> non-const-qualified pointer you could later modify the pointed-to
> memory, which would be invalid. The point of propagating the qualifiers
> is to prevent that at compile time.

Thanks for the explanation. I've committed your proposed fix.

- Melanie

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2025-12-16 16:28:11 Re: Replace is_publishable_class() with relispublishable column in pg_class
Previous Message Melanie Plageman 2025-12-16 16:05:56 Re: Fix uninitialized PruneFreezeResult in pruneheap and vacuumlazy