Improve search for missing parent downlinks in amcheck

From: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Peter Geoghegan <pg(at)bowt(dot)ie>
Subject: Improve search for missing parent downlinks in amcheck
Date: 2019-04-16 02:30:05
Message-ID: CAPpHfduoF-c4RhOyOm=4-Y367+8txq9Q6iM_ty0OYc8si1Abww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
amcheck-btree-improve-missing-parent-downlinks-check.patch application/x-patch 12.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-04-16 02:46:56 ExecForceStoreMinimalTuple leaks memory like there's no tomorrow
Previous Message Bruce Momjian 2019-04-16 02:22:34 Re: finding changed blocks using WAL scanning