Re: BUG #17212: pg_amcheck fails on checking temporary relations
Peter Geoghegan <pg@bowt.ie>
From: Peter Geoghegan <pg@bowt.ie>
To: Mark Dilger <mark.dilger@enterprisedb.com>
Cc: Alexander Lakhin <exclusion@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>,
Robert Haas <robertmhaas@gmail.com>
Date: 2021-10-04T17:58:09Z
Lists: pgsql-bugs, pgsql-hackers
On Mon, Oct 4, 2021 at 8:10 AM Mark Dilger <mark.dilger@enterprisedb.com> wrote: > > There is another issue, that maybe should be discussed separately (or > > this thread could be renamed to "... on checking specific relations"), > > but the solution could be similar to that. > > pg_amcheck also fails on checking invalid indexes, that could be created > > legitimately by the CREATE INDEX CONCURRENTLY command. > > I believe this is a bug in amcheck's btree checking functions. Peter, can you take a look? Why do you say that? verify_nbtree.c will throw an error when called with an invalid index -- which is what we actually see here. Obviously that is the intended behavior, and always has been. This hasn't been a problem before now, probably because the sample verification query in the docs (under bt_index_check()) accounts for this directly. Why shouldn't we expect pg_amcheck to do the same thing, at the SQL level? It's practically the same thing as the temp table issue. Indeed, verify_nbtree.c will throw an error on a temp table (at least if it's from another session). > I can also get this failure without pg_amcheck, going directly to the btree checking code. Having already built the table as you prescribe: > ERROR: deadlock detected > DETAIL: Process 9555 waits for ShareLock on virtual transaction 5/11; blocked by process 9558. > Process 9558 waits for ShareLock on relation 16406 of database 16384; blocked by process 9555. > HINT: See server log for query details. > ERROR: cannot check index "t_idx" > DETAIL: Index is not valid. I think that the deadlock is just another symptom of the same problem. -- Peter Geoghegan
Commits
-
Remove unstable pg_amcheck tests.
- cd3f429d9565 15.0 landed
- 5863115e4cb1 14.1 landed
-
pg_amcheck: avoid unhelpful verification attempts.
- d2bf06db3779 15.0 landed
- dd58194cf563 14.1 landed
-
amcheck: Skip unlogged relations in Hot Standby.
- 292698f158dd 15.0 landed
- e7712155ea08 14.1 landed
-
amcheck: Skip unlogged relations during recovery.
- 6754fe65a4c6 13.0 cited