pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: pgsql-hackers@lists.postgresql.org
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Andreas Karlsson <andreas@proxel.se>
Subject: Re: v12.0: segfault in reindex CONCURRENTLY
Date: Thu, 17 Oct 2019 10:04:12 +0900
Message-ID: <20191017010412.GH2602@paquier.xyz> (raw)
In-Reply-To: <20191016211146.GP3599@telsasoft.com>
References: <20191013181450.GG4475@telsasoft.com>
	<20191013191834.GA11662@alvherre.pgsql>
	<20191016211146.GP3599@telsasoft.com>

On Wed, Oct 16, 2019 at 04:11:46PM -0500, Justin Pryzby wrote:
> On Sun, Oct 13, 2019 at 04:18:34PM -0300, Alvaro Herrera wrote:
>> (FWIW I expect the crash is possible not just in reindex but also in
>> CREATE INDEX CONCURRENTLY.)
> 
> FWIW, for sake of list archives, and for anyone running v12 hoping to avoid
> crashing, I believe we hit this for DROP INDEX CONCURRENTLY, although I don't
> have the backtrace to prove it.

You may not have a backtrace, but I think that you are right:
WaitForLockers() gets called in index_drop() with progress reporting
enabled.  index_drop() would also be taken by REINDEX CONCURRENTLY
through performMultipleDeletions() but we cannot know if it gets used
for REINDEX CONCURRENTLY or for DROP INDEX CONCURRENTLY as it goes
through the central deletion machinery, so we have to mark progress
reporting as true anyway.  Maybe that's worth a comment in index_drop
when calling WaitForLockers() because it is not actually that obvious,
say like that:
@@ -2157,7 +2157,10 @@ index_drop(Oid indexId, bool concurrent, bool
concurrent_lock_mode)

    /*
     * Wait till every transaction that saw the old index state has
-    * finished.
+    * finished.  Progress reporting is enabled here for REINDEX
+    * CONCURRENTLY, but not for DROP INDEX CONCURRENTLY.  Track
+    * the progress through WaitForLockers() anyway, the information
+    * will not show up if using DROP INDEX CONCURRENTLY.
     */
    WaitForLockers(heaplocktag, AccessExclusiveLock, true);

Thoughts?
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (19+ messages)  latest in thread

Message-ID: <20191017010412.GH2602@paquier.xyz>
Permalink:  ../20191017010412.GH2602@paquier.xyz/
Also on:    postgresql.org/message-id/20191017010412.GH2602@paquier.xyz

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: michael@paquier.xyz, pryzby@telsasoft.com, alvherre@2ndquadrant.com, peter.eisentraut@2ndquadrant.com, andreas@proxel.se
  Subject: Re: v12.0: segfault in reindex CONCURRENTLY
  In-Reply-To: <20191017010412.GH2602@paquier.xyz>
  References: <20191013181450.GG4475@telsasoft.com> <20191013191834.GA11662@alvherre.pgsql> <20191016211146.GP3599@telsasoft.com> <20191017010412.GH2602@paquier.xyz>

* 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