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

From: Avinash Kumar <avinash(dot)vallarapu(at)gmail(dot)com>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: 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-15 13:56:14
Message-ID: CAN0TujePV8Q=Kzgp2Dg5H4k8H3P++XOgWQotC9ECrNBHAB21ww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Hi,

On Sun, Mar 14, 2021 at 11:24 PM Peter Geoghegan <pg(at)bowt(dot)ie> wrote:

> On Sun, Mar 14, 2021 at 6:54 PM Avinash Kumar
> <avinash(dot)vallarapu(at)gmail(dot)com> wrote:
> > Following may be helpful to understand what I meant.
> >
> > I have renamed the table and index names before adding it here.
>
> It should be possible to run amcheck on your database, which will
> detect corrupt posting list tuples on Postgres 13. It's a contrib
> extension, so you must first run "CREATE EXTENSION amcheck;". From
> there, you can run a query like the following (you may want to
> customize this):
>
> SELECT bt_index_parent_check(index => c.oid, heapallindexed => true),
> c.relname,
> c.relpages
> FROM pg_index i
> JOIN pg_opclass op ON i.indclass[0] = op.oid
> JOIN pg_am am ON op.opcmethod = am.oid
> JOIN pg_class c ON i.indexrelid = c.oid
> JOIN pg_namespace n ON c.relnamespace = n.oid
> WHERE am.amname = 'btree'
> -- Don't check temp tables, which may be from another session:
> AND c.relpersistence != 't'
> -- Function may throw an error when this is omitted:
> AND c.relkind = 'i' AND i.indisready AND i.indisvalid
> ORDER BY c.relpages DESC;
>
> If this query takes too long to complete you may find it useful to add
> something to limit the indexes check, such as: AND n.nspname =
> 'public' -- that change to the SQL will make the query just test
> indexes from the public schema.
>
> Do "SET client_min_messages=DEBUG1 " to get a kind of rudimentary
> progress indicator, if that seems useful to you.
>
I see that there are 26 Indexes for which there are 100 to thousands of
entries similar to the following. All are of course btree indexes.

psql:amchecksql.sql:17: DEBUG: leaf block 1043751 of index "idx_id_mtime"
has no first data item

And one error as follows.

psql:amchecksql.sql:17: ERROR: down-link lower bound invariant violated
for index "some_other_index"

>
> The docs have further information on what this bt_index_parent_check
> function does, should you need it:
> https://www.postgresql.org/docs/13/amcheck.html
>
> --
> Peter Geoghegan
>

--
Regards,
Avi.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rafal Pietrak 2021-03-15 15:28:42 Fwd: row level security (RLS)
Previous Message Laurenz Albe 2021-03-15 13:44:07 Re: Need help on understanding of wal_keep-segments and max_wal_size dependency.

Browse pgsql-hackers by date

  From Date Subject
Next Message David Steele 2021-03-15 13:56:25 Re: dynamic result sets support in extended query protocol
Previous Message osumi.takamichi@fujitsu.com 2021-03-15 13:14:25 RE: Enhance traceability of wal_level changes for backup management