Amcheck: do rightlink verification with lock coupling

From: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Amcheck: do rightlink verification with lock coupling
Date: 2019-09-12 13:07:57
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


This is a thread to discuss amcheck feature started in other thread[0].

Currently amcheck is scanning every B-tree level. If verification is done with ShareLock - amcheck will test that each page leftlink is pointing to page with rightlink backwards.
This is important invariant, in our experience it proved to be good at detecting various corruptions.
But this invariant can be detected only if both pages are not modified (e.g. split concurrently).

PFA patch, that in case of suspicion locks two pages and retests that invariant. This allows detection of several corruptions on standby.

This patch violates one of amcheck design principles: current code does not ever take more than one page lock. I do not know: should we hold this rule or should we use more deep check?


Best regards, Andrey Borodin.


Attachment Content-Type Size
v2-0001-In-amcheck-nbtree-do-rightlink-verification-with-loc.patch application/octet-stream 3.7 KB


Browse pgsql-hackers by date

  From Date Subject
Next Message Jeevan Chalke 2019-09-12 13:13:18 Re: block-level incremental backup
Previous Message Robert Haas 2019-09-12 13:03:43 Re: tableam vs. TOAST