Re: pgsql: Fix deadlock hazard in CREATE INDEX CONCURRENTLY

2018-02-23 Thread Tom Lane
So we're still not out of the woods with that CREATE INDEX CONCURRENTLY deadlock test. Buildfarm member okapi has failed most (not all) of its runs since that patch went in, but only in the 9.4 branch. The failures look like *** /home/data/buildfarm/root.x86_64/REL9_4_STABLE/pgsql.build/src/tes

Re: pgsql: Fix deadlock hazard in CREATE INDEX CONCURRENTLY

2018-01-03 Thread Robert Haas
On Wed, Jan 3, 2018 at 4:31 PM, Alvaro Herrera wrote: > step s8a1: LOCK TABLE a1; > step s8a1: <... completed> > step s7a8: <... completed> > error in steps s8a1 s7a8: ERROR: deadlock detected > > TBH I'm surprised that this is never reported in the other order but > that this doesn't hold for t

Re: pgsql: Fix deadlock hazard in CREATE INDEX CONCURRENTLY

2018-01-03 Thread Alvaro Herrera
Tom Lane wrote: > No, I think that's probably a bad idea, because it would mean that in > cases where you do care about the finishing order (which is all of > them up to now), the test output would fail to prove that you got the > expected behavior. Hmm .. I was thinking that we would check all t

Re: pgsql: Fix deadlock hazard in CREATE INDEX CONCURRENTLY

2018-01-03 Thread Tom Lane
Alvaro Herrera writes: > Tom Lane wrote: >> Some of the buildfarm machines still don't like this. > It proves me wrong about the ordering in which the steps return > completion being consistent: > *** > *** 20,24 > unlck > t > - step s1i: <... comp

Re: pgsql: Fix deadlock hazard in CREATE INDEX CONCURRENTLY

2018-01-03 Thread Alvaro Herrera
Tom Lane wrote: > Alvaro Herrera writes: > > Tom Lane wrote: > >> Meh. I'd rather have the more stable test going forward; I think > >> alternate expected-files too easily hide unexpected behavior. We could > >> try leaving 9.4/9.5 alone and see if it's true that it doesn't fail > >> there. If

Re: pgsql: Fix deadlock hazard in CREATE INDEX CONCURRENTLY

2018-01-03 Thread Tom Lane
Alvaro Herrera writes: > Tom Lane wrote: >> Meh. I'd rather have the more stable test going forward; I think >> alternate expected-files too easily hide unexpected behavior. We could >> try leaving 9.4/9.5 alone and see if it's true that it doesn't fail >> there. If not, I wouldn't mind losing

Re: pgsql: Fix deadlock hazard in CREATE INDEX CONCURRENTLY

2018-01-03 Thread Alvaro Herrera
Tom Lane wrote: > Alvaro Herrera writes: > > Actually, so far only 9.6 and up have failed. Maybe the old > > isolationtester is different enough that the other thing doesn't happen. > > > I'm more inclined now to add the alternate file instead of the other > > patch. > > Meh. I'd rather have

Re: pgsql: Fix deadlock hazard in CREATE INDEX CONCURRENTLY

2018-01-03 Thread Tom Lane
Alvaro Herrera writes: > Alvaro Herrera wrote: >> However this means that the test will get removed in 9.4 and 9.5 because >> isolationtester is not smart enough there. >> >> I suppose the other option would be to add an alternate expected file >> for the test. > Actually, so far only 9.6 and up

Re: pgsql: Fix deadlock hazard in CREATE INDEX CONCURRENTLY

2018-01-03 Thread Alvaro Herrera
Alvaro Herrera wrote: > However this means that the test will get removed in 9.4 and 9.5 because > isolationtester is not smart enough there. > > I suppose the other option would be to add an alternate expected file > for the test. Actually, so far only 9.6 and up have failed. Maybe the old iso

Re: pgsql: Fix deadlock hazard in CREATE INDEX CONCURRENTLY

2018-01-03 Thread Alvaro Herrera
Hello, Andres Freund wrote: > On 2018-01-03 02:20:14 +, Alvaro Herrera wrote: > > Include an isolationtester spec that 8 out of 10 times reproduces the > > deadlock with the unpatched code for me (Álvaro). > > The isolation test doesn't appear to be fully stable: > > https://buildfarm.post

Re: pgsql: Fix deadlock hazard in CREATE INDEX CONCURRENTLY

2018-01-02 Thread Andres Freund
Hi, On 2018-01-03 02:20:14 +, Alvaro Herrera wrote: > Fix deadlock hazard in CREATE INDEX CONCURRENTLY > > Multiple sessions doing CREATE INDEX CONCURRENTLY simultaneously are > supposed to be able to work in parallel, as evidenced by fixes in commit > c3d09b3bd23f specifically to support thi