# amcheck "table-matches-index" enhancement now available, detects "freeze-the-dead" corruption

DevFeed: [amcheck "table-matches-index" enhancement now available, detects "freeze-the-dead" corruption](<https://devfeed.tech/articles/amcheck-table-matches-index-enhancement-now-available-detects-freeze-the-dead-corruption-33657.md>)

Original publisher: [Read original article](<https://pgeoghegan.blogspot.com/2017/10/amcheck-table-matches-index-enhancement.html>)

Author: Peter Geoghegan (noreply@blogger.com)

Published: 2017-10-26T15:27:00Z

Content type: release

Language: en

Sources: [Peter Geoghegan's blog](<https://devfeed.tech/sources/peter-geoghegan-s-blog.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [releases](<https://devfeed.tech/topics/releases.md>), [Database](<https://devfeed.tech/topics/database.md>)

Tags: [amcheck](<https://devfeed.tech/tags/amcheck.md>), [apt](<https://devfeed.tech/tags/apt.md>), [bugs](<https://devfeed.tech/tags/bugs.md>), [index](<https://devfeed.tech/tags/index.md>), [nbtree](<https://devfeed.tech/tags/nbtree.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [release](<https://devfeed.tech/tags/release.md>), [releases](<https://devfeed.tech/tags/releases.md>)

## AI overview

The article announces the general availability of amcheck v1.2, which adds an optional check that PostgreSQL table tuples have matching index entries. It explains that the enhancement can detect logical corruption, including corruption associated with the "freeze-the-dead" bug, and notes the planned PostgreSQL point-release fixes.

## Source excerpt

I'm pleased to announce that v1.2 of amcheck, a tool for detecting that PostgreSQL relations are logically consistent (that they do not appear to be corrupt) is now generally available. This version adds a big enhancement - the optional ability to check if every tuple that should have an entry in the index does in fact have such an entry. Specifically, we check for a table entry with matching data, as well as a matching heap TID. This happens at the end of the existing tests, as an optional extra step. This enhancement is significant because it seems much more likely to catch corruption in the wild. In general, inconsistencies between a table and its indexes are more likely to occur than inconsistencies between blocks within an index for many reasons. There is simply a much larger window for an inconsistency to arise when something is amiss with database storage that breaks the assumptions PostgreSQL makes during crash recovery, for example. The enhancement is also significant because it played a role in identifying a PostgreSQL data corruption bug that will be fixed in the next point release, scheduled for November 9th, 2017. This bug affects all supported PostgreSQL versions. It was informally dubbed the "freeze-the-dead" bug. November 6 2017 update: The fix was reverted due to additional concerns that came to light. The community is working on a new, more comprehensive fix for the next point release. December 15 2017 update: A new fix has been committed, and will appear in 9.3.21, 9.4.16, 9.5.11, 9.6.7, and 10.2 point releases, scheduled for February 8th, 2018. Packages for v1.2 are available from the community Debian/Ubuntu apt repository, as well as packages from the community Redhat/CentOS/SLES yum repository. Full details on installing these packages are available from the README: https://github.com/petergeoghegan/amcheck/ "Freeze-the-dead" corruption detection I should emphasize that the bug is something that I believe to be very unlikely to hit in the real