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

From: Melanie Plageman <melanieplageman(at)gmail(dot)com>
To: Alexander Lakhin <exclusion(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Tomas Vondra <tomas(at)vondra(dot)me>, David Rowley <dgrowleyml(at)gmail(dot)com>, Kirill Reshke <reshkekirill(at)gmail(dot)com>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Andrey Borodin <x4mmm(at)yandex-team(dot)ru>, Xuneng Zhou <xunengzhou(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Subject: Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)
Date: 2026-09-11 17:24:17
Message-ID: CAAKRu_b=GfvNP4uh-SuWk9zAg0xa7OK=Uc_+mka9WTxBm0yoAg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Sep 10, 2026 at 3:25 PM Melanie Plageman
<melanieplageman(at)gmail(dot)com> wrote:
>
> It also reported that since d96f87332b3 the FSM will be less up to
> date on the standby since COPY FREEZE criteria for updating the FSM is
> if (action == BLK_NEEDS_REDO && freespace < BLCKSZ / 5) and the old
> VM record replay code had no such freespace check. I'll post a patch
> to fix that tomorrow. The fix is pretty simple: just update the FSM if
> the heap multi insert record sets the VM.

Here is a patch for this. While writing it, I realized I do not
understand why we don't update the FSM when restoring an FPI --
especially for COPY FREEZE. The FSM won't be up-to-date after
promotion for those pages and vacuum won't scan them so they'll remain
that way forever. Obviously not something to change in backbranches,
but it strikes me as odd that we do that in any cases -- but
especially for COPY FREEZE.

- Melanie

Attachment Content-Type Size
v1-0001-Update-FSM-in-COPY-FREEZE-replay.patch text/x-patch 3.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2026-09-11 17:30:43 Re: FOR PORTION OF code review
Previous Message Etsuro Fujita 2026-09-11 17:11:52 Re: Several issues with postgres_fdw stats import