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: Tue, 30 Apr 2019 14:05:50 -0400
Message-ID: <29546.1556647550@sss.pgh.pa.us> (raw)
In-Reply-To: <20190430173457.pg6i6urvevse5jer@alap3.anarazel.de>
References: <20190426020248.iyev66bkpf2abxqd@alap3.anarazel.de>
	<7882.1556290296@sss.pgh.pa.us>
	<12189.1556575627@sss.pgh.pa.us>
	<20190429220924.lfptluzkujb26y2n@alap3.anarazel.de>
	<20190430030342.jmbgnih4q3cdoufz@alap3.anarazel.de>
	<26051.1556599053@sss.pgh.pa.us>
	<BC406D10-146C-4495-AC5E-492CADBFA144@anarazel.de>
	<26528.1556599820@sss.pgh.pa.us>
	<20190430070552.jzqgcy4ihalx7nur@alap3.anarazel.de>
	<30579.1556639470@sss.pgh.pa.us>
	<20190430173457.pg6i6urvevse5jer@alap3.anarazel.de>

Andres Freund <andres@anarazel.de> writes:
> It's the lock-upgrade problem I theorized about
> upthread. ReindexIndex(), via RangeVarCallbackForReindexIndex(), takes a
> ShareLock on pg_class, and then goes on to upgrade to RowExclusiveLock
> in RelationSetNewRelfilenode(). But at that time another session
> obviously can already have the ShareLock and would also want to upgrade.

Hmm.  Note that this is totally independent of the deadlock mechanism
I reported in my last message on this thread.

I also wonder whether clobber-cache testing would expose cases
we haven't seen that trace to the additional catalog accesses
caused by cache reloads.

> I'm not sure it's worth fixing this.

I am not sure it's even *possible* to fix all these cases.  Even
if we could, it's out of scope for v12 let alone the back branches.

I think the only practical solution is to remove those reindex tests.
Even if we ran them in a script with no concurrent scripts, there'd
be risk of failures against autovacuum, I'm afraid.  Not often, but
often enough to be annoying.

Possibly we could run them in a TAP test that configures a cluster
with autovac disabled?

			regards, tom lane





view thread (82+ messages)  latest in thread

Message-ID: <29546.1556647550@sss.pgh.pa.us>
Permalink:  ../29546.1556647550@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29546.1556647550@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: <29546.1556647550@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