Re: BUG #17212: pg_amcheck fails on checking temporary relations

From: Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>, Alexander Lakhin <exclusion(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: BUG #17212: pg_amcheck fails on checking temporary relations
Date: 2021-10-06 17:19:01
Message-ID: 63FF68F5-683D-423E-A667-9C00441101A5@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

> On Oct 6, 2021, at 10:16 AM, Peter Geoghegan <pg(at)bowt(dot)ie> wrote:
>
> A return value of 0 cannot be said to indicate that the database is
> not corrupt;

Nor can a non-zero value be said to indicate that the database is corrupt.

These invocations will still return a non-zero exit status:

pg_amcheck -D no_privs_database
pg_amcheck --index="no_such_index"
pg_amcheck --table="somebody_elses_temp_table"
pg_amcheck --index="somebody_elses_temp_index"

but these have been modified to no longer do so:

pg_amcheck -D my_database_in_recovery --parent-check
pg_amcheck -D my_database_in_recovery --heapallindexed
pg_amcheck --all

Please compare to:

find /private || echo "FAIL"
rm /not/my/file || echo "FAIL"

I'm not sure how the idea that pg_amcheck should never give back a failure code unless there is corruption got inserted into this thread, but I'm not on board with that as an invariant statement. The differences in the upcoming version are

1) --all no longer means "all relations" but rather "all checkable relations"
2) checking options should be automatically downgraded under circumstances where they cannot be applied
3) unlogged relations during replication are by definition not corrupt

I think #1 and #3 are unsurprising enough that they need no documentation update. #2 is slightly surprising (at least to me) so I updated the docs for it.


Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Geoghegan 2021-10-06 17:39:03 Re: BUG #17212: pg_amcheck fails on checking temporary relations
Previous Message Peter Geoghegan 2021-10-06 17:16:09 Re: BUG #17212: pg_amcheck fails on checking temporary relations

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2021-10-06 17:19:23 Re: pg_walinspect - a new extension to get raw WAL data and WAL stats
Previous Message Peter Geoghegan 2021-10-06 17:16:09 Re: BUG #17212: pg_amcheck fails on checking temporary relations