From: Andres Freund <andres@anarazel.de>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Jeff Janes <jeff.janes@gmail.com>
Cc: pgsql-committers@postgresql.org
Subject: Re: pgsql: Fix deadlock hazard in CREATE INDEX CONCURRENTLY
Date: Tue, 2 Jan 2018 19:44:45 -0800
Message-ID: <20180103034445.t3utrtrnrevfsghm@alap3.anarazel.de> (raw)
In-Reply-To: <E1eWYf8-0001NW-4n@gemulon.postgresql.org>
References: <E1eWYf8-0001NW-4n@gemulon.postgresql.org>
Hi,
On 2018-01-03 02:20:14 +0000, Alvaro Herrera wrote:
> Fix deadlock hazard in CREATE INDEX CONCURRENTLY
>
> Multiple sessions doing CREATE INDEX CONCURRENTLY simultaneously are
> supposed to be able to work in parallel, as evidenced by fixes in commit
> c3d09b3bd23f specifically to support this case. In reality, one of the
> sessions would be aborted by a misterious "deadlock detected" error.
>
> Jeff Janes diagnosed that this is because of leftover snapshots used for
> system catalog scans -- this was broken by 8aa3e47510b9 keeping track of
> (registering) the catalog snapshot. To fix the deadlocks, it's enough
> to de-register that snapshot prior to waiting.
>
> Backpatch to 9.4, which introduced MVCC catalog scans.
>
> Include an isolationtester spec that 8 out of 10 times reproduces the
> deadlock with the unpatched code for me (Álvaro).
The isolation test doesn't appear to be fully stable:
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=baiji&dt=2018-01-03%2003%3A00%3A01
Greetings,
Andres Freund
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-committers@postgresql.org
Cc: andres@anarazel.de, alvherre@alvh.no-ip.org, jeff.janes@gmail.com
Subject: Re: pgsql: Fix deadlock hazard in CREATE INDEX CONCURRENTLY
In-Reply-To: <20180103034445.t3utrtrnrevfsghm@alap3.anarazel.de>
References: <E1eWYf8-0001NW-4n@gemulon.postgresql.org> <20180103034445.t3utrtrnrevfsghm@alap3.anarazel.de>
* 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