Re: Deadlock between concurrent index builds on different tables

2018-01-03 Thread Jeff Janes
On Tue, Dec 26, 2017 at 10:03 PM, Jeremy Finzel wrote: > > > Many thanks for the great and simple explanation. > > I was able to get this compiled, and ran the test before on stock 9.6.6, > then on this patched version. I indeed reproduced it on 9.6.6, but on the > patched

Re: Deadlock between concurrent index builds on different tables

2017-12-26 Thread Michael Paquier
On Wed, Dec 27, 2017 at 12:27:05AM +0100, Alban Hertroys wrote: > >> On 26 Dec 2017, at 18:11, Alvaro Herrera wrote: > > … > > > 3. configure and make > > ./configure > > make > > make install > > … > > > For the options in step 3 you could use whatever your

Re: Deadlock between concurrent index builds on different tables

2017-12-26 Thread Alban Hertroys
> On 26 Dec 2017, at 18:11, Alvaro Herrera wrote: … > 3. configure and make > ./configure > make > make install … > For the options in step 3 you could use whatever your current server > has; use "pg_config --configure" to find these out. You're gonna need >

Re: Deadlock between concurrent index builds on different tables

2017-12-26 Thread Alvaro Herrera
Jeremy Finzel wrote: > On Tue, Dec 26, 2017 at 10:28 AM, Alvaro Herrera > wrote: > > > Jeremy Finzel wrote: > > > > > > > >> Each index build needs to wait for all other transactions > > > >> (Including the ones used by the other index build) to finish. > > > >> So I

Re: Deadlock between concurrent index builds on different tables

2017-12-26 Thread Jeremy Finzel
On Tue, Dec 26, 2017 at 10:28 AM, Alvaro Herrera wrote: > Jeremy Finzel wrote: > > > > > > > > >> Each index build needs to wait for all other transactions > > >> (Including the ones used by the other index build) to finish. > > >> So I don't think a deadlock here is

Re: Deadlock between concurrent index builds on different tables

2017-12-26 Thread Alvaro Herrera
Jeremy Finzel wrote: > > > > > >> Each index build needs to wait for all other transactions > >> (Including the ones used by the other index build) to finish. > >> So I don't think a deadlock here is unexpected. > Does that mean I should never build more than one concurrent index at > a time

Re: Deadlock between concurrent index builds on different tables

2017-12-23 Thread Jeremy Finzel
> > The only thing I can think of is that there's a foreign key from foo to > bar(id), but the create index on bar shouldn't prevent a share lock on > foo, even if such a restriction exists. > > -- > Martín Marquéshttp://www.2ndQuadrant.com/ > PostgreSQL Development, 24x7 Support,

Re: Deadlock between concurrent index builds on different tables

2017-12-23 Thread Jeremy Finzel
> > >> Each index build needs to wait for all other transactions (Including the > ones used by the other index build) to finish. So I don't think a deadlock > here is unexpected. > > Cheers, > > Jeff > Does that mean I should never build more than one concurrent index at a time within the entire

Re: Deadlock between concurrent index builds on different tables

2017-12-23 Thread Jeff Janes
On Fri, Dec 22, 2017 at 1:53 PM, Jeremy Finzel wrote: > I am attempting to build several indexes in parallel, guaranteeing that I > never build one on the same table twice. I understand I can't build two on > the same table at once or I will get a deadlock. However, I am

Re: Deadlock between concurrent index builds on different tables

2017-12-23 Thread Martin Marques
El 23/12/17 a las 08:08, Alban Hertroys escribió: > >> On 22 Dec 2017, at 22:53, Jeremy Finzel 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

Re: Deadlock between concurrent index builds on different tables

2017-12-23 Thread Alban Hertroys
> On 22 Dec 2017, at 22:53, Jeremy Finzel 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