pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: wangchuanting <wangchuanting@huawei.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Subject: Re: Re: BUG #14680: startup process on standby encounter a deadlock of TwoPhaseStateLock when redo 2PC xlog
Date: Wed, 14 Jun 2017 11:35:10 -0400
Message-ID: <20170614153510.l57n2dgr3ukkgla4@alvherre.pgsql> (raw)
In-Reply-To: <CAB7nPqQnfR5aHr+Qtr2RJiw59yOkcQSrhTto2ZfDqFVn+iGmtw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Michael Paquier wrote:
> On Wed, Jun 14, 2017 at 8:08 AM, Alvaro Herrera
> <alvherre@2ndquadrant.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.

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


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (30+ messages)  latest in thread

Message-ID: <20170614153510.l57n2dgr3ukkgla4@alvherre.pgsql>
Permalink:  ../20170614153510.l57n2dgr3ukkgla4@alvherre.pgsql/
Also on:    postgresql.org/message-id/20170614153510.l57n2dgr3ukkgla4@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: alvherre@2ndquadrant.com, michael.paquier@gmail.com, wangchuanting@huawei.com
  Subject: Re: Re: BUG #14680: startup process on standby encounter a deadlock of TwoPhaseStateLock when redo 2PC xlog
  In-Reply-To: <20170614153510.l57n2dgr3ukkgla4@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox