Re: WAL_LOG CREATE DATABASE strategy broken for non-standard page layouts

From: Zhijie Hou <houzhijie22(at)gmail(dot)com>
To: Melanie Plageman <melanieplageman(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Rogers Wang <rogers(dot)ww(at)qq(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Álvaro Herrera <alvherre(at)kurilemu(dot)de>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: WAL_LOG CREATE DATABASE strategy broken for non-standard page layouts
Date: 2026-11-14 13:08:18
Message-ID: 6e62d593-a8b2-415d-834d-e54ed519bb04@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Wed, Nov11, 2026 at 06:10 AM Melanie Plageman wrote:
>
> Attached v2 uses a hybrid approach that passes page_std for heap
> tables and btree indexes as well as when the data between pd_upper and
> pd_lower is all zeroes. That allows other AMs to zero out that area if
> they want to preserve the old behavior and avoid a regression (which I
> think was what you were suggesting).
While analyzing an issue related to the visibility map, I reviewed the
0001 patch a bit. The fix looks good to me.

I just have one minor comment on the TAP test in 0001. IIUC, the
pre-existing test in 034_create_database.pl was added by commit
8a8661828ae to verify that when CREATE DATABASE loads the template's
pg_class into shared_buffers, it marks those buffers as permanent so
that a subsequent checkpoint flushes them to disk.

But with 0001, the modified test vacuuming tab_db_before_create_1 in
template1 beforehand loads template1's pg_class into shared_buffers with
BM_PERMANENT already set before CREATE DATABASE runs. If we want to keep
the original regression coverage, maybe we could run the new test steps
after the pre-existing test.

--
Best Regards,
Zhijie Hou

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Burd 2026-11-14 13:14:21 Re: Let an ordering index scan hand its ORDER BY value to the target list
Previous Message Tatsuya Kawata 2026-11-14 12:34:09 Speed up hash join builds by linking tuples into buckets in groups