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

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Melanie Plageman <melanieplageman(at)gmail(dot)com>
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-13 13:59:29
Message-ID: bfc015b8-eaea-423d-9a09-1d39c4fe9947@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 20.11.25 18:19, Melanie Plageman wrote:
> + prstate->deadoffsets = (OffsetNumber *) presult->deadoffsets;

In your patch
v22-0001-Split-heap_page_prune_and_freeze-into-helpers.patch, the
assignment above casts away the const qualification of the function
argument presult:

+static void
+prune_freeze_setup(PruneFreezeParams *params,
+ TransactionId new_relfrozen_xid,
+ MultiXactId new_relmin_mxid,
+ const PruneFreezeResult *presult,
+ PruneState *prstate)

(The cast is otherwise unnecessary, since the underlying type is the
same on both sides.)

Since prstate->deadoffsets is in fact later modified, this makes the
original const qualification invalid.

I suggest the attached patch to remove the faulty const qualification
and the then-unnecessary cast.

Attachment Content-Type Size
0001-Fix-const-qualification-in-prune_freeze_setup.patch.nocfbot text/plain 1.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Sami Imseih 2025-12-13 14:21:58 Re: Proposal: Add a callback data parameter to GetNamedDSMSegment
Previous Message Sami Imseih 2025-12-13 13:48:20 Re: Support named (destination) portals in extended proto for psql meta commands.