pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Geoghegan <pg@bowt.ie>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Teach amcheck to verify sibling links in all cases.
Date: Sat, 08 Aug 2020 18:12:55 +0000
Message-ID: <E1k4TKx-0004PJ-3n@gemulon.postgresql.org> (raw)

Teach amcheck to verify sibling links in all cases.

Teach contrib/amcheck's bt_index_check() function to check agreement
between siblings links.  The left sibling's right link should point to a
right sibling page whose left link points back to the same original left
sibling.  This extends a check that bt_index_parent_check() always
performed to bt_index_check().

This is the first time amcheck has been taught to perform buffer lock
coupling, which we have explicitly avoided up until now.  The sibling
link check tends to catch a lot of real world index corruption with
little overhead, so it seems worth accepting the complexity.  Note that
the new lock coupling logic would not work correctly on replica servers
without the changes made by commits 0a7d771f and 9a9db08a (there could
be false positives without those changes).

Author: Andrey Borodin, Peter Geoghegan
Discussion: https://postgr.es/m/0EB0CFA8-CBD8-4296-8049-A2C0F28FAE8C@yandex-team.ru

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/39132b784aeaaacf5ddfb5c35b6e29a6926f4345

Modified Files
--------------
contrib/amcheck/verify_nbtree.c | 173 ++++++++++++++++++++++++++++++++++------
1 file changed, 150 insertions(+), 23 deletions(-)



Message-ID: <E1k4TKx-0004PJ-3n@gemulon.postgresql.org>
Permalink:  ../E1k4TKx-0004PJ-3n@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1k4TKx-0004PJ-3n@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: pg@bowt.ie
  Subject: Re: pgsql: Teach amcheck to verify sibling links in all cases.
  In-Reply-To: <E1k4TKx-0004PJ-3n@gemulon.postgresql.org>
  References: <E1k4TKx-0004PJ-3n@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox