pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Geoghegan <pg@bowt.ie>
To: Anastasia Lubennikova <a.lubennikova@postgrespro.ru>
Cc: andrewbille@gmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Cc: Alexander Korotkov <aekorotkov@gmail.com>
Subject: Re: BUG #16619: Amcheck detects corruption in hstore' btree index (ver 2)
Date: Wed, 16 Sep 2020 10:47:19 -0700
Message-ID: <CAH2-WzkSjsCHgs9YdBiFdC8iV_14rWO2R_VRsQaS_Mj-5H0Vnw@mail.gmail.com> (raw)
In-Reply-To: <8ede01d3-f09c-248e-9494-63628ff3cf56@postgrespro.ru>
References: <16619-aaba10f83fdc1c3c@postgresql.org>
	<8ede01d3-f09c-248e-9494-63628ff3cf56@postgrespro.ru>

On Wed, Sep 16, 2020 at 7:24 AM Anastasia Lubennikova
<a.lubennikova@postgrespro.ru> wrote:
> For v2 indexes pivot tuple's offset can contain any random number which
> will lead to bt_pivot_tuple_identical() failure.
>
> The fix is pretty simple - only compare data part of the tuples. I think
> we can skip offnum check for all index versions to keep the code simple.

I pushed a tweaked version of this patch. It seemed worth preserving
the inclusion of offset number in the bt_pivot_tuple_identical()
memcmp() comparison. The field contains important metadata that really
should match. Also, I made sure to compare t_info field on all indexes
(including pg_upgrade'd indexes) for the same reason.

We already account for heapkeyspace difference in other similar
routines, such as invariant_l_offset().  It's not hard to do this here
as well.

Thanks
-- 
Peter Geoghegan





view thread (5+ messages)  latest in thread

Message-ID: <CAH2-WzkSjsCHgs9YdBiFdC8iV_14rWO2R_VRsQaS_Mj-5H0Vnw@mail.gmail.com>
Permalink:  ../CAH2-WzkSjsCHgs9YdBiFdC8iV_14rWO2R_VRsQaS_Mj-5H0Vnw@mail.gmail.com/
Also on:    postgresql.org/message-id/CAH2-WzkSjsCHgs9YdBiFdC8iV_14rWO2R_VRsQaS_Mj-5H0Vnw@mail.gmail.com

 · 

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-bugs@postgresql.org
  Cc: pg@bowt.ie, a.lubennikova@postgrespro.ru, aekorotkov@gmail.com
  Subject: Re: BUG #16619: Amcheck detects corruption in hstore' btree index (ver 2)
  In-Reply-To: <CAH2-WzkSjsCHgs9YdBiFdC8iV_14rWO2R_VRsQaS_Mj-5H0Vnw@mail.gmail.com>
  References: <16619-aaba10f83fdc1c3c@postgresql.org> <8ede01d3-f09c-248e-9494-63628ff3cf56@postgrespro.ru> <CAH2-WzkSjsCHgs9YdBiFdC8iV_14rWO2R_VRsQaS_Mj-5H0Vnw@mail.gmail.com>

* 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