Re: REINDEX INDEX results in a crash for an index of pg_class since 9.6

From: Shaoqi Bai <sbai(at)pivotal(dot)io>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: REINDEX INDEX results in a crash for an index of pg_class since 9.6
Date: 2019-04-25 10:37:04
Message-ID: CAGRcZQVzR6A+ggfcAdMOLc1vGSHXEpeE=rjoRJUpO9QQfYx90A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 24, 2019 at 7:55 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Michael Paquier <michael(at)paquier(dot)xyz> writes:
> > On Tue, Apr 23, 2019 at 04:47:19PM -0400, Tom Lane wrote:
> >> Is there some precondition you're not mentioning?
>
> > Hm. In my own init scripts, I create a new database just after
> > starting the instance.
>
> Ah, there we go:
>
> regression=# create database d1;
> CREATE DATABASE
> regression=# \c d1
> You are now connected to database "d1" as user "postgres".
> d1=# reindex index pg_class_relname_nsp_index;
> psql: server closed the connection unexpectedly
>
> log shows
>
> TRAP:
> FailedAssertion("!(!ReindexIsProcessingIndex(((indexRelation)->rd_id)))",
> File: "indexam.c", Line: 204)
>

Could reproduce TRAP:
FailedAssertion("!(!ReindexIsProcessingIndex(((indexRelation)->rd_id)))",
File: "indexam.c", Line: 204) in postgres log file.

> #2 0x00000000008c74ed in ExceptionalCondition (
> conditionName=<value optimized out>, errorType=<value optimized out>,
> fileName=<value optimized out>, lineNumber=<value optimized out>)
> at assert.c:54
> #3 0x00000000004e4f8c in index_insert (indexRelation=0x7f80f849a5d8,
> values=0x7ffc4f65b030, isnull=0x7ffc4f65b130, heap_t_ctid=0x2842c0c,
> heapRelation=0x7f80f84bab68, checkUnique=UNIQUE_CHECK_YES,
> indexInfo=0x2843230) at indexam.c:204
> #4 0x000000000054c290 in CatalogIndexInsert (indstate=<value optimized
> out>,
> heapTuple=0x2842c08) at indexing.c:140
> #5 0x000000000054c472 in CatalogTupleUpdate (heapRel=0x7f80f84bab68,
> otid=0x2842c0c, tup=0x2842c08) at indexing.c:215
> #6 0x00000000008bca77 in RelationSetNewRelfilenode
> (relation=0x7f80f849a5d8,
> persistence=112 'p') at relcache.c:3531
> #7 0x0000000000548b3a in reindex_index (indexId=2663,
> skip_constraint_checks=false, persistence=112 'p', options=0)
> at index.c:3339
> #8 0x00000000005ed099 in ReindexIndex (indexRelation=<value optimized
> out>,
> options=0, concurrent=false) at indexcmds.c:2304
> #9 0x00000000007b5925 in standard_ProcessUtility (pstmt=0x281fd70,
>
But could only see these stack in lldb -c corefile after type bt. Is there
a way to also print these stack in postgres log file , and how?

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2019-04-25 11:15:44 Re: POC: Cleaning up orphaned files using undo logs
Previous Message Amit Langote 2019-04-25 10:02:12 Re: BUG #15672: PostgreSQL 11.1/11.2 crashed after dropping a partition table