Adding Peter G. to CC.
On 2019-Jul-05, PG Bug reporting form wrote:
> When pg_upgrading from 10-or-earlier to 12beta2 or 13devel, an assertion is
> raised. (Spotted by Debian's postgresql-common upgrade tests. Previously
> missed because we were only testing version+1 upgrades.)
>
> TRAP: FailedAssertion(»!(metad->btm_version >= 3)«, Datei:
> »/build/postgresql-12-3URvLF/postgresql-12-12~beta2/build/../src/backend/access/nbtree/nbtpage.c«,
> Zeile: 665)
Seems that _bt_getrootheight is too optimistic about the metapage
version it'll find. I suppose this could be handled by just not caching
the metapage if it is of the old version ... or maybe by calling
_bt_upgrademetapage().
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services