Re: new heapcheck contrib module

Mark Dilger <mark.dilger@enterprisedb.com>

From: Mark Dilger <mark.dilger@enterprisedb.com>
To: Andres Freund <andres@anarazel.de>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>, Peter Geoghegan <pg@bowt.ie>, Robert Haas <robertmhaas@gmail.com>
Date: 2020-04-29T16:30:28Z
Lists: pgsql-hackers

Attachments

>> I wonder if a mode where heapcheck optionally would only checks
>> non-frozen (perhaps also non-all-visible) regions of a table would be a
>> good idea?

Version 4 of this patch now includes boolean options skip_all_frozen and skip_all_visible.

>> Would make it a lot more viable to run this regularly on
>> bigger databases. Even if there's a window to not check some data
>> (because it's frozen before the next heapcheck run).

Do you think it would make sense to have the amcheck contrib module have, in addition to the SQL queriable functions, a bgworker based mode that periodically checks your database?  The work along those lines is not included in v4, but if it were part of v5, would you have specific design preferences?

Commits

  1. Add pg_amcheck, a CLI for contrib/amcheck.

  2. Refactor and generalize the ParallelSlot machinery.

  3. Generalize parallel slot result handling.

  4. Move some code from src/bin/scripts to src/fe_utils to permit reuse.

  5. Factor pattern-construction logic out of processSQLNamePattern.

  6. Doc: clean up verify_heapam() documentation.

  7. Fix more portability issues in new amcheck code.

  8. Fix portability issues in new amcheck test.

  9. Try to avoid a compiler warning about using fxid uninitialized.

  10. Extend amcheck to check heap pages.

  11. Adjust walsender usage of xlogreader, simplify APIs

  12. Improve checking of child pages in contrib/amcheck.

  13. Sanitize line pointers within contrib/amcheck.

  14. Fix possible sorting error when aborting use of abbreviated keys.