Re: Re: BUG #14680: startup process on standby encounter a deadlock of TwoPhaseStateLock when redo 2PC xlog

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: wangchuanting <wangchuanting(at)huawei(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Re: BUG #14680: startup process on standby encounter a deadlock of TwoPhaseStateLock when redo 2PC xlog
Date: 2017-06-14 21:57:55
Message-ID: CAB7nPqQyz813gQou30KHZtH98oZh5P=4diyvVtX0eLvWwecTMA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Thu, Jun 15, 2017 at 12:35 AM, Alvaro Herrera
<alvherre(at)2ndquadrant(dot)com> wrote:
> Michael Paquier wrote:
>> On Wed, Jun 14, 2017 at 8:08 AM, Alvaro Herrera
>> <alvherre(at)2ndquadrant(dot)com> wrote:
>> > So I propose that RecoverPreparedTransactions grabs exclusive lock at
>> > the top, and only the bottom part of the loop is done unlocked, which
>> > AFAICS should be safe. (MarkAsPrepared gained a boolean argument
>> > indicating that caller already holds lock).
>>
>> Logically both approaches are really close as with this approach the
>> additional locked area is when scanning the entries of TwoPhaseState.
>> But I agree that your suggestion would be safer in the long run. This
>> looks good to me after a close look.
>
> Thanks, pushed.

Thanks for the commit.
--
Michael

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message khuddleston 2017-06-14 23:22:59 BUG #14706: Dependencies not recorded properly for base types
Previous Message David G. Johnston 2017-06-14 20:07:58 Re: BUG #14662: 'has_table_privilege()' function fails with error, "invalid name syntax" when using Japanese symbols

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-06-14 22:01:58 Re: intermittent failures in Cygwin from select_parallel tests
Previous Message Tom Lane 2017-06-14 21:42:28 Re: intermittent failures in Cygwin from select_parallel tests