pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alban Hertroys <haramrae@gmail.com>
To: Jeremy Finzel <finzelj@gmail.com>
Cc: Postgres General <pgsql-general@postgresql.org>
Subject: Re: Deadlock between concurrent index builds on different tables
Date: Sat, 23 Dec 2017 12:08:42 +0100
Message-ID: <C9622A36-D10E-44CC-B98F-460657B5BF85@gmail.com> (raw)
In-Reply-To: <CAMa1XUhHjCv8Qkx0WOr1Mpm_R4qxN26EibwCrj0Oor2YBUFUTg@mail.gmail.com>
References: <CAMa1XUhHjCv8Qkx0WOr1Mpm_R4qxN26EibwCrj0Oor2YBUFUTg@mail.gmail.com>


> On 22 Dec 2017, at 22:53, Jeremy Finzel <finzelj@gmail.com> wrote:
> 
> 2017-12-22 15:48:07.669 CST,"CREATE INDEX",2017-12-22 15:48:02 CST,8/32,0,ERROR,40P01,"deadlock detected","Process 4470 waits for ShareLock on virtual transaction 4/262; blocked by process 4466.
> Process 4466 waits for ShareLock on virtual transaction 8/32; blocked by process 4470.
> Process 4470: CREATE INDEX CONCURRENTLY index_foo_on_created_at ON foo USING btree (created_at);
> Process 4466: CREATE INDEX CONCURRENTLY index_bar_on_id ON bar USING btree (id);","See server log for query details.",,,,"CREATE INDEX CONCURRENTLY index_foo_on_created_at ON foo USING btree (created_at);",,,""

If I read these logs correctly, you are creating the exact same index on foo (created_at) in both processes, which is just what you were trying to prevent doing.

Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.





view thread (15+ messages)  latest in thread

Message-ID: <C9622A36-D10E-44CC-B98F-460657B5BF85@gmail.com>
Permalink:  ../C9622A36-D10E-44CC-B98F-460657B5BF85@gmail.com/
Also on:    postgresql.org/message-id/C9622A36-D10E-44CC-B98F-460657B5BF85@gmail.com

 · 

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-general@postgresql.org
  Cc: haramrae@gmail.com, finzelj@gmail.com
  Subject: Re: Deadlock between concurrent index builds on different tables
  In-Reply-To: <C9622A36-D10E-44CC-B98F-460657B5BF85@gmail.com>
  References: <CAMa1XUhHjCv8Qkx0WOr1Mpm_R4qxN26EibwCrj0Oor2YBUFUTg@mail.gmail.com> <C9622A36-D10E-44CC-B98F-460657B5BF85@gmail.com>

* 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