Re: pg_stat_database.checksum_failures misses single-page failures in backups

From: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
To: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Yilin Zhang <jiezhilove(at)126(dot)com>
Subject: Re: pg_stat_database.checksum_failures misses single-page failures in backups
Date: 2026-08-17 14:32:09
Message-ID: CAN55FZ0UX=wB+d=u56K2dnAf8mGmLUEbWdUYxboPLmxLm6fm2Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Mon, 17 Aug 2026 at 16:11, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com> wrote:
>
> This issue was reported by Yilin Zhang in another backup related thread[1]
>
> When basebackup finds exactly one corrupted page in a file, the backup
> fails as expected with a per-page warning and then an error. However,
> it doesn't update the statistics, because that update is currently
> inside the per-file summary for 2 or more checksum failures.
>
> This issue seems to exists since the introduction of the feature (6b9e875f728).
>
> The attached patch moves the statistics report into its own block.

I was reading the related thread [1] and I think you are right, it is
an oversight. Your analysis and fix look correct to me.

[1] https://postgr.es/m/flat/20180228180856.GE13784%40nighthawk.caipicrew.dd-dns.de

--
Regards,
Nazir Bilal Yavuz
Microsoft

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2026-08-17 14:38:30 Re: pg_control_checkpoint(): add "data_checksum_version" (Pg19)?
Previous Message Palak Chaturvedi 2026-08-17 14:26:18 Re: Changing shared_buffers without restart