Re: BUG #15896: pg_upgrade from 10-or-earlier: TRAP: FailedAssertion(»!(metad->btm_version >= 3)«

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Christoph Berg <myon(at)debian(dot)org>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>, Teodor Sigaev <teodor(at)sigaev(dot)ru>
Subject: Re: BUG #15896: pg_upgrade from 10-or-earlier: TRAP: FailedAssertion(»!(metad->btm_version >= 3)«
Date: 2019-07-16 02:01:58
Message-ID: CAH2-Wz=jvYQmPgSxZCdHe1NwK+S3j1jF6ydc1G0eHs7BNdpn2w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Jul 5, 2019 at 3:14 PM Peter Geoghegan <pg(at)bowt(dot)ie> wrote:
> The problem here predates v12 -- the call to _bt_cachemetadata() was
> added to _bt_getrootheight() by commit 0a64b45152b, which went into
> v11. My commit dd299df8189 added a new assertion that fails, but
> that's just a symptom -- I changed the code in _bt_getrootheight() to
> use a BTMetaPageData pointer to shared memory (i.e. a pointer to the
> authoritative version), rather than using the newly-out-of-sync cached
> version. It shouldn't be out-of-sync at all.

The attached HEAD-only patch fixes the issue by not actually upgrading
the page within _bt_cachemetadata(), while making some existing
assertions less aggressive. I haven't tested it properly just yet --
ran out of time to do that today.

Maybe you can try this out with your original test case, Christoph?

Thanks
--
Peter Geoghegan

Attachment Content-Type Size
0001-Fix-nbtree-metapage-cache-upgrade-bug.patch application/octet-stream 4.3 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2019-07-16 02:50:28 Re: [BUG?] Missing OID column from pl/pgsql record
Previous Message Prakash Ramakrishnan 2019-07-16 01:47:14 Re: perl issue