new heapcheck contrib module - Mailing list pgsql-hackers

From Mark Dilger
Subject new heapcheck contrib module
Date
Msg-id 12ED3DA8-25F0-4B68-937D-D907CFBF08E7@enterprisedb.com
Whole thread Raw
Responses Re: new heapcheck contrib module  (Peter Geoghegan <pg@bowt.ie>)
Re: new heapcheck contrib module  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Hackers,

I have been talking with Robert about table corruption that occurs from time to time. The page checksum feature seems
sufficientto detect most random corruption problems, but it can't detect "logical" corruption, where the page is valid
butinconsistent with the rest of the database cluster. This can happen due to faulty or ill-conceived backup and
restoretools, or bad storage, or user error, or bugs in the server itself. (Also, not everyone enables checksums.) 

The attached module provides the means to scan a relation and sanity check it. Currently, it checks xmin and xmax
valuesagainst relfrozenxid and relminmxid, and also validates TOAST pointers. If people like this, it could be expanded
toperform additional checks. 

There was a prior v1 patch, discussed offlist with Robert, not posted.  Here is v2:



—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company




Attachment

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: more ALTER .. DEPENDS ON EXTENSION fixes
Next
From: Robert Haas
Date:
Subject: Re: fixing old_snapshot_threshold's time->xid mapping