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

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Avinash Kumar <avinash(dot)vallarapu(at)gmail(dot)com>
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 02:23:46
Message-ID: CAH2-WznahyQuiqv0d5SaZORZTzCpJfWpvLUuKnkdLhnuJYgwYg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

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.

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rafal Pietrak 2021-03-15 07:57:35 row level security (RLS)
Previous Message Avinash Kumar 2021-03-15 01:54:13 Re: Postgres crashes at memcopy() after upgrade to PG 13.

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2021-03-15 02:47:15 Re: Change JOIN tutorial to focus more on explicit joins
Previous Message Peter Geoghegan 2021-03-15 02:04:34 Re: New IndexAM API controlling index vacuum strategies