pgsql: amcheck: Skip unlogged relations in Hot Standby. - Mailing list pgsql-committers

From Peter Geoghegan
Subject pgsql: amcheck: Skip unlogged relations in Hot Standby.
Date
Msg-id E1ma5Zj-0005yK-Nb@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
amcheck: Skip unlogged relations in Hot Standby.

Have verify_heapam.c treat unlogged relations as if they were simply
empty when in Hot Standby mode.  This brings it in line with
verify_nbtree.c, which has handled unlogged relations in the same way
since bugfix commit 6754fe65a4.  This was an oversight in commit
866e24d47d, which extended contrib/amcheck to check heap relations.

In passing, lower the verbosity used when reporting that a relation has
been skipped like this, from NOTICE to DEBUG1.  This is appropriate
because the skipping behavior is only an implementation detail, needed
to work around the fact that unlogged tables don't have smgr-level
storage for their main fork when in Hot Standby mode.

Affected unlogged relations should be considered "trivially verified",
not skipped over.  They are verified in the same sense that a totally
empty relation can be verified.  This behavior seems least surprising
overall, since unlogged relations on a replica will initially be empty
if and when the replica is promoted and Hot Standby ends.

Author: Mark Dilger <mark.dilger@enterprisedb.com>
Reviewed-By: Peter Geoghegan <pg@bowt.ie>
Discussion: https://postgr.es/m/CAH2-Wzk_pukOFY7JmdiFLsrz+Pd3V8OwgC1TH2Vd5BH5ZgK4bA@mail.gmail.com
Backpatch: 14-, where heapam verification was introduced.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/292698f158ddb3f9a88f536e6eecb9e55d9619c9

Modified Files
--------------
contrib/amcheck/verify_heapam.c | 16 ++++++++++++++++
contrib/amcheck/verify_nbtree.c |  5 +++--
2 files changed, 19 insertions(+), 2 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Make configure check for minimum required version of IPC::Run.
Next
From: Fujii Masao
Date:
Subject: pgsql: Make autovacuum launcher more responsive to pg_log_backend_memor