pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Lakhin <exclusion@gmail.com>
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17959: amcheck fails to find a matching index tuple for an invisible heap tuple
Date: Mon, 5 Jun 2023 12:00:01 +0300
Message-ID: <bc2bd0cc-4a19-b311-043f-f9a40e71dfe8@gmail.com> (raw)
In-Reply-To: <17959-0d691c29037366ab@postgresql.org>
References: <17959-0d691c29037366ab@postgresql.org>

03.06.2023 22:00, PG Bug reporting form wrote:
> The following bug has been logged on the website:
>
> Bug reference:      17959
> Logged by:          Alexander Lakhin
> Email address:      exclusion@gmail.com
> PostgreSQL version: 16beta1
> Operating system:   Ubuntu 22.04
> Description:
>
> After some DDL/transactional operations (a reproducer to follow)
> pg_amcheck detects an anomaly:
> btree index "regress001.pg_catalog.pg_depend_reference_index":
>      ERROR:  heap tuple (13,35) from table "pg_depend" lacks matching index
> tuple within index "pg_depend_reference_index"

The operations that trigger that anomaly are as follows:
my $bsession1 = $node->background_psql('regress001');
$bsession1->query_safe("create temp table t1(a int)");
my $bsession2 = $node->background_psql('regress002');
$bsession2->query_safe("begin transaction");
$bsession2->query_safe("prepare transaction 'pt1'");
$bsession1->quit;
my $bsession3 = $node->background_psql('regress001');
$bsession3->query_safe("create temp table t1(a int)");
$bsession3->query_safe("vacuum t1");
$bsession2->quit;
$bsession3->quit;

A complete TAP test to reproduce the issue is attached.
I put it in src/bin/pg_amcheck/t/, run (on master, e6a254c0d)
PROVE_TESTS=t/099_pdri_error.pl make -s check -C src/bin/pg_amcheck/
and get:

#   Failed test 'pg_amcheck after manipulations stdout /(?^:^$)/'
#   at t/099_pdri_error.pl line 60.
#                   'btree index "regress001.pg_catalog.pg_depend_reference_index":
#     ERROR:  heap tuple (13,35) from table "pg_depend" lacks matching index tuple within index "pg_depend_reference_index"
# '
#     doesn't match '(?^:^$)'

Best regards,
Alexander

Attachments:

  099_pdri_error.pl (application/x-perl, 2.3K) download

view thread (5+ messages)  latest in thread

Message-ID: <bc2bd0cc-4a19-b311-043f-f9a40e71dfe8@gmail.com>
Permalink:  ../bc2bd0cc-4a19-b311-043f-f9a40e71dfe8@gmail.com/
Also on:    postgresql.org/message-id/bc2bd0cc-4a19-b311-043f-f9a40e71dfe8@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17959: amcheck fails to find a matching index tuple for an invisible heap tuple
  In-Reply-To: <bc2bd0cc-4a19-b311-043f-f9a40e71dfe8@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox