Re: Silent data corruption in PostgreSQL 17 - how to detect it proactively?

From: Pawel Kudzia <kudzia(at)gmail(dot)com>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: Vladlen Popolitov <v(dot)popolitov(at)postgrespro(dot)ru>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Silent data corruption in PostgreSQL 17 - how to detect it proactively?
Date: 2026-02-21 10:20:07
Message-ID: CAJYBUS8UQboD_cNC9qzPSai1iyY4m1eExy1GRnJEJfZX0p4Psw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Sep 16, 2025 at 6:41 PM Merlin Moncure <mmoncure(at)gmail(dot)com> wrote:
>
> On Tue, Sep 16, 2025 at 7:25 AM Vladlen Popolitov <v(dot)popolitov(at)postgrespro(dot)ru> wrote:
>>
>> Checksum calculation takes ~0.5% of query time, it is not bottleneck
>> in PostgreSQL.
>
>
> I consider checksums=on to be a mandatory setting. Often, these types of things are not bugs in postgres itself, but bugs in storage, the underlying operating system, or extensions. Checksums can and will protect you, and may even bring you close to the thing causing the corruption. Given that your replica is ok, this very much smells like a similar type of issue.
>
> In a prior case, I was using pl/sh to load data to the database with 'copy', and for what I believe to be o/s issues, was getting corruption. Enabling checksums completely addressed the source of the damage. Turn them on!
>

i'd like to add a note that might help others - at the end - it was
not PostgreSQL, but a bug in underlying KVM when snapshots were
active. it hit others as well and at the time of writing is not
resolved yet - https://gitlab.com/qemu-project/qemu/-/issues/3273

thanks a lot for help and suggestions!

--
regards,
Pawel Kudzia

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter J. Holzer 2026-02-21 12:40:55 Re: Can we get sha* function over text, that could be used in index?
Previous Message Linus Heckemann 2026-02-21 09:54:53 Re: Can we get sha* function over text, that could be used in index?