From: | Peter Geoghegan <pg(at)bowt(dot)ie> |
---|---|
To: | "Andrey V(dot) Lepikhov" <a(dot)lepikhov(at)postgrespro(dot)ru> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: [WIP] [B-Tree] Retail IndexTuple deletion |
Date: | 2018-06-19 02:29:00 |
Message-ID: | CAH2-Wz=-8ZEcVUm9=e-OyOmTtjLetVk=E2T_=TjF6qMePEhz8Q@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Mon, Jun 18, 2018 at 4:05 PM, Peter Geoghegan <pg(at)bowt(dot)ie> wrote:
> IOW, the approach you've taken in bttargetdelete() isn't quite correct
> because you imagine that it's okay to occasionally "lose" the index
> tuple that you originally found, and just move on. That needs to be
> 100% reliable, or else we'll end up with index tuples that point to
> the wrong heap tuples in rare cases with concurrent insertions.
Attached patch adds a new amcheck check within
bt_index_parent_check(). With the patch, heap TIDs are accumulated in
a tuplesort and sorted at the tail end of verification (before
optional heapallindexed verification runs). This will reliably detect
the kind of corruption I noticed was possible with your patch.
Note that the amcheck enhancement that went along with my
heap-tid-btree-sort patch may not have detected this issue, which is
why I wrote this patch -- the heap-tid-btree-sort amcheck stuff could
detect duplicates, but only when all other attributes happened to be
identical when comparing sibling index tuples (i.e. only when we must
actually compare TIDs across sibling index tuples). If you add this
check, I'm pretty sure that you can detect any possible problem. You
should think about using this to debug your patch.
I may get around to submitting this to a CF, but that isn't a priority
right now.
--
Peter Geoghegan
Attachment | Content-Type | Size |
---|---|---|
0001-Detect-duplicate-heap-TIDs-using-a-tuplesort.patch | application/octet-stream | 4.9 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2018-06-19 03:13:10 | Re: pg_config.h.win32 missing a set of flags from pg_config.h.in added in v11 development |
Previous Message | Michael Paquier | 2018-06-19 02:21:31 | Adding tests for inheritance trees with temporary tables |