Re: WAL record CRC calculated incorrectly because of underlying buffer modification

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Greg Burd <greg(at)burd(dot)me>
Cc: pgsql-hackers(at)postgresql(dot)org, michael(at)paquier(dot)xyz, andres(at)anarazel(dot)de, pgsql(at)j-davis(dot)com, thomas(dot)munro(at)gmail(dot)com, exclusion(at)gmail(dot)com, amit(dot)kapila16(at)gmail(dot)com, hlinnaka(at)iki(dot)fi
Subject: Re: WAL record CRC calculated incorrectly because of underlying buffer modification
Date: 2026-11-02 06:04:52
Message-ID: CALDaNm2AVp6C23PEH3O_DV1nXzqZh00-fGAyUjecWpU+Y6_nXA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 28 Oct 2026 at 20:24, vignesh C <vignesh21(at)gmail(dot)com> wrote:
>
> Few comments:
> 1. The README, the macro comment, the code comment and the commit
> message say such a buffer "never has a full-page image taken". The
> code is include_image = needs_backup, so an image is still taken when
> needs_backup is true. For example, _hash_freeovflpage() registers the
> write buffer with REGBUF_STANDARD | REGBUF_NO_CHANGE, without
> REGBUF_NO_IMAGE, when the primary bucket page is the write page and no
> tuples are moved onto it. After a checkpoint, that record carries an
> ordinary FPI of the page.
> + The REGBUF_NO_CHANGE flag indicates that the buffer is registered without
> + being modified by this record, and possibly without an exclusive content
> + lock (for example, to force a cleanup lock on the block during replay).
> + Such a buffer never has a full-page image taken, not even when WAL
> + consistency checking is enabled: its contents may change concurrently
>
> Is this ok, or should we mention like "no consistency-check image"

I noticed that the patch has been committed. I thought this comment
might have been missed during the discussion, so here is a small
follow-up patch to clarify the behavior and avoid confusion: "This
does not affect full-page images used for torn-page protection."

Regards,
Vignesh

Attachment Content-Type Size
v1-0001-Clarify-full-page-image-behavior-of-REGBUF_NO_CHA.patch application/octet-stream 1.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tender Wang 2026-11-02 06:18:35 Re: A gap in preventing bogus parameterizations in a798660ebe3
Previous Message Chao Li 2026-11-02 05:34:47 Re: Fix trigger memory leak