Deadlock during CREATE INDEX CONCURRENTLY, but index still created

From: Florian Weimer <fweimer(at)bfk(dot)de>
To: pgsql-admin(at)postgresql(dot)org
Subject: Deadlock during CREATE INDEX CONCURRENTLY, but index still created
Date: 2011-05-18 15:19:21
Message-ID: 82k4doujd2.fsf@mid.bfk.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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(at)bfk(dot)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

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Florian Weimer 2011-05-18 15:32:59 Re: Deadlock during CREATE INDEX CONCURRENTLY, but index still created
Previous Message Eric Comeau 2011-05-18 09:06:42 Re: postgres on CVFS / StorNext filesystem