Re: Deadlock in multiple CIC. - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Deadlock in multiple CIC.
Date
Msg-id 20180104122925.h2fmxf3tnk666c6k@alvherre.pgsql
Whole thread Raw
In response to Re: Deadlock in multiple CIC.  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: Deadlock in multiple CIC.
List pgsql-hackers
Alvaro Herrera wrote:

> Pushed to all affected branches, along with a somewhat lame
> isolationtester test for the condition (since we've already broken this
> twice and not noticed for long).

Buildfarm member okapi just failed this test in 9.4:

2018-01-04 02:44:43.481 PST [5a4e059a.3af1:6] ERROR:  deadlock detected
2018-01-04 02:44:43.481 PST [5a4e059a.3af1:7] DETAIL:  Process 15089 waits for ShareLock on virtual transaction 4/882;
blockedby process 15090.
 
    Process 15090 waits for ShareLock on virtual transaction 3/906; blocked by process 15089.
    Process 15089: 
            CREATE INDEX CONCURRENTLY mcic_one_pkey ON mcic_one (id)
            WHERE lck_shr(281457);
    
    Process 15090: 
            CREATE INDEX CONCURRENTLY mcic_two_pkey ON mcic_two (id)
            WHERE unlck();
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=okapi&dt=2018-01-04%2010%3A35%3A02

The interesting thing here is that the failure seems to be just like
before the patch: each session is waiting on a snapshot from the other
session.  I suppose this must be some *other* snapshot, not the catalog
snapshot ...

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Enhance pg_stat_wal_receiver view to display connected host
Next
From: Vik Fearing
Date:
Subject: Re: pgbench - add \if support