• Peter Geoghegan's avatar
    amcheck: Skip unlogged relations in Hot Standby. · e7712155
    Peter Geoghegan authored
    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 6754fe65.  This was an oversight in commit
    866e24d4, 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: default avatarPeter Geoghegan <pg@bowt.ie>
    Discussion: https://postgr.es/m/CAH2-Wzk_pukOFY7JmdiFLsrz+Pd3V8OwgC1TH2Vd5BH5ZgK4bA@mail.gmail.com
    Backpatch: 14-, where heapam verification was introduced.
    e7712155
verify_nbtree.c 120 KB