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

From: Oleksii Kliukin <alexk(at)hintbits(dot)com>
To: Álvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Avoid spurious deadlocks when upgrading a tuple lock
Date: 2019-06-19 14:08:31
Message-ID: 2A0C6E60-661D-47BB-888C-F557D4E7458A@hintbits.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> wrote:

> On 2019-Jun-18, Oleksii Kliukin wrote:
>
>> Sorry, I was confused, as I was looking only at
>> https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=de87a084c0a5ac927017cd0834b33a932651cfc9
>>
>> without taking your subsequent commit that silences compiler warnings at
>> https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=3da73d6839dc47f1f47ca57974bf28e5abd9b572
>> into consideration. With that commit, the danger is indeed in resetting the
>> skip mechanism on each jump and potentially causing deadlocks.
>
> Yeah, I understand the confusion.
>
> Anyway, as bugs go, this one seems pretty benign. It would result in a
> unexplained deadlock, very rarely, and only for people who use a very
> strange locking pattern that includes (row-level) lock upgrades. I
> think it also requires aborted savepoints too, though I don't rule out
> the possibility that there might be a way to reproduce this without
> that.
>
> I pushed the patch again just now, with the new permutation.

Thank you very much for working on it and committing the fix!

Cheers,
Oleksii

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2019-06-19 19:31:23 pgsql: Add XSL stylesheet to fix up SVG files
Previous Message Magnus Hagander 2019-06-19 13:00:02 pgsql: Fix typo

Browse pgsql-hackers by date

  From Date Subject
Next Message Rui Hai Jiang 2019-06-19 14:27:03 Re: How to produce a Soft Block case of Deadlock Detection?
Previous Message Dmitry Dolgov 2019-06-19 13:57:29 Re: Index Skip Scan