pg_stat_database.checksum_failures misses single-page failures in backups

Поиск
Список
Период
Сортировка
Искать

pg_stat_database.checksum_failures misses single-page failures in backups

От:
Zsolt Parragi <zsolt.parragi@percona.com>
Дата:
Вложения:
Hello!

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.

[1] : https://www.postgresql.org/message-id/34b127c.6e5d.1a00f5540f9.Coremail.jiezhilove%40126.com

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

От:
Michael Paquier <michael@paquier.xyz>
Дата:
Вложения:
On Tue, Aug 18, 2026 at 08:11:04AM +0900, Michael Paquier wrote:
> Users tend to ignore entirely WARNINGs in my experience, but it also
> sounds to me that it is better to inform if the stats view has been
> incremented at all even if only one page was iffy, starting at
> strictly more than 0, not strictly more than 1 because the information
> is still useful.

In order to close the loop, I have been doing some archeology.

I can track the original code change in the v5 posted here, which has
been using a (> 1) for the sake of the plural message, at least that
feels like the author's intention:
https://www.postgresql.org/message-id/20180331125404.GA20852%40nighthawk.caipicrew.dd-dns.de

I would still just adjust the one-off in the if condition at the end.
Reporting also a WARNING even if we have 1 checksum failure feels like
the right thing to do.
--
Michael
FAQ