Re: BUG #17485: Records missing from Primary Key index when doing REINDEX INDEX CONCURRENTLY
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Robert Haas <robertmhaas@gmail.com>, Andrey Borodin <x4mmm@yandex-team.ru>, Peter Geoghegan <pg@bowt.ie>, Michael Paquier <michael@paquier.xyz>, Петър Славов <pet.slavov@gmail.com>, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2022-05-25T17:08:21Z
Lists: pgsql-bugs
Hi, On 2022-05-25 18:43:22 +0200, Alvaro Herrera wrote: > On 2022-May-25, Robert Haas wrote: > > Also, it seems like it would require complex new infrastructure that I > > think we should be reluctant to invent in back branches. > > This is definitely true. And I think this would be expensive, because > we'd have to check in every heap_page_prune call. I think the cost could be addressed, along the lines of the mechanism I put in as part of the snapshot scalability work. I.e. don't compute an accurate horizon when not needed for pruning, only do so when within a certain range of xids. But it seems still way too invasive for the back branches. Quite obviously we need a lot more testing for this etc. I'm also doubtful it's the right approach. The problem here comes from needing a snapshot for the entire duration of the validation scan. ISTM that we should work on not needing that snapshot, rather than trying to reduce the consequences of holding that snapshot. I think it might be possible to avoid it. Random sketch: We could prevent HOT updates during CIC for rows inserted during the first scan. If we did that we IIRC could rely on the xids of the last row version to determine whether an index insertion is needed during the validation scan. > > It seems to me that we should just revert. > > Deciding to revert makes me sad, because this feature is extremely > valuable for users. However, I understand the danger and I don't > disagree with the rationale so I can't really object. I sadly don't see how we could develop a reliable reimplementation of this feature without delaying (or destabilizing) the release... Greetings, Andres Freund
Commits
-
Revert changes to CONCURRENTLY that "sped up" Xmin advance
- e28bb8851969 15.0 landed
- 042b584c7f7d 14.4 landed
-
Fix possible HOT corruption when RECENTLY_DEAD changes to DEAD while pruning.
- 18b87b201f73 15.0 cited