Re: Postgres crashes at memcopy() after upgrade to PG 13.

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Avinash Kumar <avinash(dot)vallarapu(at)gmail(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Postgres crashes at memcopy() after upgrade to PG 13.
Date: 2021-03-16 18:23:37
Message-ID: CAH2-Wzk+9WRAdsabe+8W=TYz-503h026j7WbcVjN2wWr+=Jr3A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Tue, Mar 16, 2021 at 11:08 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Peter Geoghegan <pg(at)bowt(dot)ie> writes:
> > ... It's hard to believe that the problem is
> > squarely with _bt_swap_posting().
>
> IIUC, the problem is seen on a replica server but not the primary?
> In that case, my thoughts would run towards a bug in WAL log creation
> or replay, causing the index contents to be different/wrong on the
> replica.

My remarks were intended to include problems during recovery
(_bt_swap_posting() is run inside REDO routines). Though I did
consider recovery specifically when thinking through the problem.

My assessment is that the index is highly unlikely to be corrupt
(whether it happened during recovery or at some other time), because
it passes validation by bt_index_parent_check(), with the optional
heapallindexed index-matches-table verification option enabled. This
includes exhaustive verification of posting list tuple invariants.

Anything is possible, but I find it easier to believe that the issue
is somewhere else -- we see the problem in _bt_swap_posting() because
it happens to go further than other code in trusting that the tuple
isn't corrupt (which it shouldn't). Another unrelated index *was*
reported corrupt by amcheck, though the error in question does not
suggest an issue with deduplication.

--
Peter Geoghegan

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Anderson 2021-03-16 18:25:16 Re: WAL-files is not removing authomaticaly
Previous Message Avinash Kumar 2021-03-16 18:20:34 Re: Postgres crashes at memcopy() after upgrade to PG 13.

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2021-03-16 18:24:23 Re: pg_amcheck contrib application
Previous Message Tom Lane 2021-03-16 18:22:34 Re: pg_amcheck contrib application