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

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Alexander Lakhin <exclusion(at)gmail(dot)com>
Cc: Mark Dilger <mark(dot)dilger(at)enterprisedb(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-04 20:37:30
Message-ID: CAH2-Wznk8ocGOvNMHyHC=M8iE88O5pJv+ud_BVV3ZpnZamnOBQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Mon, Oct 4, 2021 at 2:00 AM Alexander Lakhin <exclusion(at)gmail(dot)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.

Thanks for the report!

I wonder if verify_heapam.c does the right thing with unlogged tables
when verification runs on a standby -- a brief glance at the code
leaves me with the impression that it's not handled there. Note that
verify_nbtree.c initially got it wrong. The issue was fixed by bugfix
commit 6754fe65. Before then nbtree verification could throw a nasty
low-level smgr error, just because we had an unlogged table in hot
standby mode.

Note that we deliberately skip indexes when this happens (we don't
error out), unlike the temp buffers (actually temp table) case. This
seems like the right set of behaviors. We really don't want to have to
throw an "invalid object type" style error just because verification
runs during recovery. Plus it just seems logical to assume that
unlogged indexes/tables don't have storage when we're in hot standby
mode, and so must simply have nothing for us to verify.

--
Peter Geoghegan

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Mark Dilger 2021-10-04 22:36:06 Re: BUG #17212: pg_amcheck fails on checking temporary relations
Previous Message David.Oberg 2021-10-04 18:56:39 Repo error for pgdg14

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2021-10-04 20:49:45 Re: ssl tests fail on windows / slurp_file() offset doesn't work on win
Previous Message Tom Lane 2021-10-04 19:54:00 Re: Duplicat-word typos in code comments