pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: REINDEX INDEX results in a crash for an index of pg_class since 9.6
Date: Wed, 01 May 2019 12:20:22 -0400
Message-ID: <25049.1556727622@sss.pgh.pa.us> (raw)
In-Reply-To: <20190501013638.7u7fwr4zktbyyng5@alap3.anarazel.de>
References: <20190430173457.pg6i6urvevse5jer@alap3.anarazel.de>
	<29546.1556647550@sss.pgh.pa.us>
	<20190430182741.s6o7mo5ebmgxxi5x@alap3.anarazel.de>
	<16277.1556649660@sss.pgh.pa.us>
	<20190430190308.kga2z5oz7vab7w22@alap3.anarazel.de>
	<17996.1556651503@sss.pgh.pa.us>
	<20190430221045.6slpi2vm2noda5jb@alap3.anarazel.de>
	<28313.1556663080@sss.pgh.pa.us>
	<28926.1556664156@sss.pgh.pa.us>
	<20190430225307.lvfvcf2776iywhw4@alap3.anarazel.de>
	<20190501013638.7u7fwr4zktbyyng5@alap3.anarazel.de>

Andres Freund <andres@anarazel.de> writes:
> I see the bug. Turns out we need to figure out another way to solve the
> assertion triggered by doing catalog updates within
> RelationSetNewRelfilenode() - we can't just move the
> SetReindexProcessing() before it.  When CCA is enabled, the
> CommandCounterIncrement() near the tail of RelationSetNewRelfilenode()
> triggers a rebuild of the catalog entries - but without the
> SetReindexProcessing() those scans will try to use the index currently
> being rebuilt.

Yeah.  I think what this demonstrates is that REINDEX INDEX has to have
RelationSetIndexList logic similar to what REINDEX TABLE has, to control
which indexes get updated when while we're rebuilding an index of
pg_class.  In hindsight that seems glaringly obvious ... I wonder how we
missed that when we built that infrastructure for REINDEX TABLE?

I'm pretty sure that infrastructure is my fault, so I'll take a
whack at fixing this.

Did you figure out why this doesn't also happen in HEAD?

			regards, tom lane





view thread (82+ messages)  latest in thread

Message-ID: <25049.1556727622@sss.pgh.pa.us>
Permalink:  ../25049.1556727622@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/25049.1556727622@sss.pgh.pa.us

 · 

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-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, michael@paquier.xyz, pgsql-hackers@lists.postgresql.org
  Subject: Re: REINDEX INDEX results in a crash for an index of pg_class since 9.6
  In-Reply-To: <25049.1556727622@sss.pgh.pa.us>

* 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