Re: xid wraparound danger due to INDEX_CLEANUP false - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: xid wraparound danger due to INDEX_CLEANUP false
Date
Msg-id CAH2-WznFoJZEZHYPJKOn9xJCLQUERJEEhc2TvtFsOUmvDBdDxg@mail.gmail.com
Whole thread Raw
In response to Re: xid wraparound danger due to INDEX_CLEANUP false  (Peter Geoghegan <pg@bowt.ie>)
List pgsql-hackers
On Wed, Apr 29, 2020 at 2:04 PM Peter Geoghegan <pg@bowt.ie> wrote:
> As a bonus, we now have an easy correctness cross-check: if some
> random piece of nbtree code lands on a page (having followed a
> downlink or sibling link) that is marked recycled, then clearly
> something is very wrong -- throw a "can't happen" error.

If this doesn't sound that appealing to any of you, then bear this in
mind: nbtree has a terrifying tendency to *not* produce wrong answers
to queries when we land on a concurrently-recycled page.
_bt_moveright() is willing to move right as many times as it takes to
arrive at the correct page, even though in typical cases having to
move right once is rare -- twice is exceptional. I suppose that there
is roughly a 50% chance that we'll end up landing at a point in the
key space that is to the left of the point where we're supposed to
arrive at.  It might take many, many page accesses before
_bt_moveright() finds the correct page, but that often won't be very
noticeable. Or if it is noticed, corruption won't be suspected --
we're still getting a correct answer.

-- 
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: xid wraparound danger due to INDEX_CLEANUP false
Next
From: "Jonah H. Harris"
Date:
Subject: Re: Proposing WITH ITERATIVE