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: Alexander Lakhin <exclusion(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: BUG #17212: pg_amcheck fails on checking temporary relations
Date: 2021-10-05 03:19:02
Message-ID: CACF59A6-865B-4D42-B8E4-39CD64F8CEA4@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

> On Oct 4, 2021, at 6:19 PM, Peter Geoghegan <pg(at)bowt(dot)ie> wrote:
>
> I don't see what the point of this example is.

It doesn't matter.

I am changing pg_amcheck to filter out indexes as you say. Since the btree check should no longer error in these cases, the issue of pg_amcheck exit(2) sorts itself out without further code changes.

I am changing verify_heapam to skip unlogged tables during recovery. In testing, checking such a table results in a simple notice:

NOTICE: cannot verify unlogged relation "u_tbl" during recovery, skipping

While testing, I also created an index on the unlogged table and checked that index using bt_index_parent_check, and was surprised that checking it using bt_index_parent_check raises an error:

ERROR: cannot acquire lock mode ShareLock on database objects while recovery is in progress
HINT: Only RowExclusiveLock or less can be acquired on database objects during recovery.

It doesn't get as far as btree_index_mainfork_expected(). So I am changing pg_amcheck to filter out indexes when pg_is_in_recovery() is true and relpersistence='u'. Does that sound right to you?


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-05 03:28:46 Re: BUG #17212: pg_amcheck fails on checking temporary relations
Previous Message David Rowley 2021-10-05 01:59:40 Re: BUG #17213: Wrong result from a query involving Merge Semi Join and Memoize

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2021-10-05 03:21:39 Re: Make relfile tombstone files conditional on WAL level
Previous Message Stephen Frost 2021-10-05 03:18:12 Re: parallelizing the archiver