Improve search for missing parent downlinks in amcheck - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Improve search for missing parent downlinks in amcheck
Date
Msg-id CAPpHfduoF-c4RhOyOm=4-Y367+8txq9Q6iM_ty0OYc8si1Abww@mail.gmail.com
Whole thread Raw
Responses Re: Improve search for missing parent downlinks in amcheck
List pgsql-hackers
Hi!

Currently we amcheck supports lossy checking for missing parent
downlinks.  It collects bitmap of downlink hashes and use it to check
subsequent tree level.  We've experienced some large corrupted indexes
which pass this check due to its looseness.

However, it seems to me we can implement this check in non-lossy
manner without making it significantly slower.  We anyway traverse
downlinks from parent to children in order to verify that hikeys are
corresponding to downlink keys.  We can also traverse from one
downlink to subsequent using rightlinks.  So, if there are some
intermediate pages between them, they are candidates to have missing
parent downlinks.  The patch is attached.

With this patch amcheck could successfully detect corruption for our
customer, which unpatched amcheck couldn't find.

Opinions?

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Attachment

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: finding changed blocks using WAL scanning
Next
From: Tom Lane
Date:
Subject: ExecForceStoreMinimalTuple leaks memory like there's no tomorrow