Re: pgsql: Avoid spurious deadlocks when upgrading a tuple lock

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, alexk(at)hintbits(dot)com
Subject: Re: pgsql: Avoid spurious deadlocks when upgrading a tuple lock
Date: 2019-06-15 17:01:33
Message-ID: 20190615170133.GA28251@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 2019-Jun-14, Alvaro Herrera wrote:

> I think there are worse problems here. I tried the attached isolation
> spec. Note that the only difference in the two permutations is that s0
> finishes earlier in one than the other; yet the first one works fine and
> the second one hangs until killed by the 180s timeout. (s3 isn't
> released for a reason I'm not sure I understand.)

Actually, those behaviors both seem correct to me now that I look
closer. So this was a false alarm. In the code before de87a084c0, the
first permutation deadlocks, and the second permutation hangs. The only
behavior change is that the first one no longer deadlocks, which is the
desired change.

I'm still trying to form a case to exercise the case of skip_tuple_lock
having the wrong lifetime.

The fact that both permutations behave differently, even though the
only difference is where s0 commits relative to the s3_share step, is an
artifact of our unusual tuple locking implementation.

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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andrew Gierth 2019-06-15 17:46:41 pgsql: Prefer timezone name "UTC" over alternative spellings.
Previous Message Tom Lane 2019-06-15 16:25:39 Re: pgsql: Avoid spurious deadlocks when upgrading a tuple lock

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-06-15 17:01:41 Re: Extracting only the columns needed for a query
Previous Message Tom Lane 2019-06-15 16:25:39 Re: pgsql: Avoid spurious deadlocks when upgrading a tuple lock