pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Florian Weimer <fweimer@bfk.de>
To: pgsql-admin@postgresql.org
Subject: Deadlock during CREATE INDEX CONCURRENTLY, but index still created
Date: Wed, 18 May 2011 15:19:21 +0000
Message-ID: <82k4doujd2.fsf@mid.bfk.de> (raw)

I've run two CREATE INDEX CONCURRENTLY on the same table in parallel,
and one of them errored out with:

2011-05-18 14:30:06.645 UTC bfk 23530 postgres ERROR:  deadlock
  detected
2011-05-18 14:30:06.645 UTC bfk 23530 postgres DETAIL:  Process
  23530 waits for ShareLock on virtual transaction 9/28523127; blocked by
  process 26612.
        Process 26612 waits for ShareUpdateExclusiveLock on relation
        229701 of database 229155; blocked by process 23530.
        Process 23530: CREATE INDEX CONCURRENTLY idx1 ON tbl (col1);
        Process 26612: CREATE INDEX CONCURRENTLY idx2 ON tbl (col);

The curious thing is that both indexes were created.  I would have
expected that the creation of idx1 would be rolled back.

Are both of the usable, or should I re-create idx1 from scratch?

This is with PostgreSQL 8.4.7.  (The changelog for 8.4.8 does not list
anything which appears to be relevant.)

-- 
Florian Weimer                <fweimer@bfk.de>
BFK edv-consulting GmbH       http://www.bfk.de/
Kriegsstraße 100              tel: +49-721-96201-1
D-76133 Karlsruhe             fax: +49-721-96201-99



view thread (3+ messages)  latest in thread

Message-ID: <82k4doujd2.fsf@mid.bfk.de>
Permalink:  ../82k4doujd2.fsf@mid.bfk.de/
Also on:    postgresql.org/message-id/82k4doujd2.fsf@mid.bfk.de

 · 

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-admin@postgresql.org
  Cc: fweimer@bfk.de
  Subject: Re: Deadlock during CREATE INDEX CONCURRENTLY, but index still created
  In-Reply-To: <82k4doujd2.fsf@mid.bfk.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