From: Michael Paquier <michael@paquier.xyz>
To: Rogers Wang <rogers.ww@qq.com>
Cc: pgsql-hackers@lists.postgresql.org, Matthias van de Meent <boekewurm+postgres@gmail.com>
Cc: Álvaro Herrera <alvherre@kurilemu.de>
Cc: melanieplageman@gmail.com
Subject: Re: WAL_LOG CREATE DATABASE strategy broken for non-standard page layouts
Date: Mon, 31 Aug 2026 14:37:46 +0900
Message-ID: <apUTKUUvYfG3SlBF@paquier.xyz> (raw)
In-Reply-To: <tencent_2E870046716FD94285045E96505A2D4E2908@qq.com>
References: <202602021525.qv4m7oge4eca@alvherre.pgsql>
<tencent_2E870046716FD94285045E96505A2D4E2908@qq.com>
On Mon, Aug 24, 2026 at 01:04:44AM +0800, Rogers Wang wrote:
> What changed since the last discussion
> --------------------------------------
> The divergence was assessed back then as "not actively harmful". That
> no longer holds in v19: commit add323da40a added
> Assert(BufferIsDirty(vmbuffer)) to heap_xlog_prune_freeze(), which
> makes the divergence fatal on assert builds after a switchover:
>
> 1. The promoted standby has a zeroed VM, so VACUUM FREEZE sets the
> bits again, emitting PRUNE records with no FPI for the VM buffer.
> 2. The old primary, rejoined as standby, still has the bits set with
> an older page LSN, so replay takes the redo branch - but
> visibilitymap_set() is a no-op there (bits already set) and the
> buffer stays clean.
> 3. Assert(BufferIsDirty(vmbuffer)) fires, and the node crash-loops on
> that record.
>
> And even without assertions, the new database on the standby silently
> loses all all-visible/all-frozen bits and all free space data of every
> copied relation.
Hmm. This warrants an open item for v19, at least to be discussed.
Adding Melanie in CC as the committer of add323da40a.
--
Michael
Attachments:
[application/pgp-signature] signature.asc (832B, ../apUTKUUvYfG3SlBF@paquier.xyz/2-signature.asc)
download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: michael@paquier.xyz, rogers.ww@qq.com, boekewurm+postgres@gmail.com, alvherre@kurilemu.de, melanieplageman@gmail.com
Subject: Re: WAL_LOG CREATE DATABASE strategy broken for non-standard page layouts
In-Reply-To: <apUTKUUvYfG3SlBF@paquier.xyz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox