Re: BUG #15896: pg_upgrade from 10-or-earlier: TRAP: FailedAssertion(»!(metad->btm_version >= 3)«
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>, Christoph Berg <myon@debian.org>, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>, Teodor Sigaev <teodor@sigaev.ru>, Alexander Korotkov <a.korotkov@postgrespro.ru>
Date: 2019-07-11T08:15:53Z
Lists: pgsql-bugs
On Thu, Jul 11, 2019 at 12:18:46AM -0700, Peter Geoghegan wrote: > On Fri, Jul 5, 2019 at 3:14 PM Peter Geoghegan <pg@bowt.ie> wrote: >> _bt_getrootheight() is mostly just something that exists for the >> planner, so it has no business calling _bt_cachemetadata(), which will >> "upgrade" the cached metadata image from version 2 to version 3 if it >> happens to be on version 2. How can it be okay to upgrade the cached >> version without also upgrading the on-disk/shared_buffers version? >> This bug was hiding in plain sight. > > CC'ing Alexander, who was also involved in commit 0a64b45152b... So the problem has been introduced in v11 per this commit, still we only see the issue since v12 because your code relied on a wrong assumption. Per what I am reading, it seems to me that we should fix v11, but that's a live problem for v12 because of the page format upgrade so we need to track it as an open item. -- Michael
Commits
-
Fix nbtree metapage cache upgrade bug.
- d004147eb3ec 13.0 landed
- 7772dece9850 12.0 landed
- 6523f2ed3441 11.5 landed
-
Make heap TID a tiebreaker nbtree index column.
- dd299df8189b 12.0 cited
-
Fix handling of non-upgraded B-tree metapages
- 0a64b45152b5 11.0 cited
-
Skip full index scan during cleanup of B-tree indexes when possible
- 857f9c36cda5 11.0 cited