pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Better fix for deadlock hazard in CREATE INDEX CONCURRENTLY.
Date: Wed, 18 Apr 2018 16:07:55 +0000
Message-ID: <E1f8pch-0004po-Hu@gemulon.postgresql.org> (raw)

Better fix for deadlock hazard in CREATE INDEX CONCURRENTLY.

Commit 54eff5311 did not account for the possibility that we'd have
a transaction snapshot due to default_transaction_isolation being
set high enough to require one.  The transaction snapshot is enough
to hold back our advertised xmin and thus risk deadlock anyway.
The only way to get rid of that snap is to start a new transaction,
so let's do that instead.  Also throw in an assert checking that we
really have gotten to a state where no xmin is being advertised.

Back-patch to 9.4, like the previous commit.

Discussion: https://postgr.es/m/CAMkU=1ztk3TpQdcUNbxq93pc80FrXUjpDWLGMeVBDx71GHNwZQ@mail.gmail.com

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/82acf3eb7db92640f16a1197e62f2dceba77415c

Modified Files
--------------
src/backend/commands/indexcmds.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)



view thread (5+ messages)  latest in thread

Message-ID: <E1f8pch-0004po-Hu@gemulon.postgresql.org>
Permalink:  ../E1f8pch-0004po-Hu@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1f8pch-0004po-Hu@gemulon.postgresql.org

 · 

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-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Better fix for deadlock hazard in CREATE INDEX CONCURRENTLY.
  In-Reply-To: <E1f8pch-0004po-Hu@gemulon.postgresql.org>
  References: <E1f8pch-0004po-Hu@gemulon.postgresql.org>

* 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