Re: Logging corruption error codes - Mailing list pgsql-bugs

From Peter Geoghegan
Subject Re: Logging corruption error codes
Date
Msg-id CAH2-Wzk+5G6R3jPYCXKCODWGrMxs0vxKurJcPJdXMp6pOZJ7LQ@mail.gmail.com
Whole thread Raw
In response to Re: Logging corruption error codes  (Andrey Borodin <x4mmm@yandex-team.ru>)
Responses Re: Logging corruption error codes
List pgsql-bugs
On Thu, Jul 25, 2019 at 3:45 AM Andrey Borodin <x4mmm@yandex-team.ru> wrote:
> From my POV these messages provide meaningful information to cope with corruption. But they are definitely internal.
> Translations already provide some information on toast chunks, mentions btree many times times and many other
internalthings.
 
> So, I'm confused about status of these messages.
> Such messages should be rare enough and those to whom they are addressed should be familiar with English.

I agree that these don't need to be translated, which means you must
use errmsg_internal() with ereport(). A message like "failed to
re-find parent key in index..." doesn't mean anything to more than a
tiny number of experts. It is useful only because you can paste in
into a search engine. Users will want to search for the English string
anyway.

> This causes various data corruptions, always undetected by data checksums (do we want Merkle tree?).

I don't think that it's possible to verify the integrity of multiple
page images without amcheck support for the access method. It might be
possible to do slightly more in a generic way, but I doubt it.

> Besides messages in this patch we also had:
> could not read block 1751 in file "base/16452/358336": Bad address  // Probably mostly not only data corruption, but
hardwarefault
 
> t_xmin is uncommitted in tuple to be updated // Probably on-disk corruption
> failed to re-find parent key in index // Probably index corruption
> left link changed unexpectedly in block // Probably on-disk data corruption
> right sibling 45056 of block * is not next child * of block * in index // Definitely index corruption
>
> Should I add corruption codes for these messages in the patch? Or make a separate discussion about these?

I don't think that we need to worry too much about the difference
between data corruption and a hardware fault that could theoretically
self-correct. There is a cost to making fine distinctions like this in
the errcodes we use.

-- 
Peter Geoghegan



pgsql-bugs by date:

Previous
From: Jorge Gustavo Rocha
Date:
Subject: Re: BUG #15827: Unable to connect on Windows using pg_services.conf using Python psycopg2
Next
From: Tom Lane
Date:
Subject: Re: AW: BUG #15923: Prepared statements take way too much memory.