pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomonari Katsumata <katsumata.tomonari@po.ntts.co.jp>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #8434: Why does dead lock occur many times ?
Date: Thu, 28 Nov 2013 13:00:33 +0900
Message-ID: <5296BFE1.2090906@po.ntts.co.jp> (raw)
In-Reply-To: <20131127164226.GA14522@eldon.alvh.no-ip.org>
References: <E1VH9At-0005VC-Kk@wrigleys.postgresql.org>
	<20131004172217.GW5235@eldon.alvh.no-ip.org>
	<20131127164226.GA14522@eldon.alvh.no-ip.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Hi Alvaro

I applied all patches you told me against 93_STABLE.
But I could not build the source with the patches.

It seems your patch use GetMultiXactIdMembers with four arguments,
but the function requires three arguments.
----
nmembers = GetMultiXactIdMembers(rawxmax, &members, false, false);
----

do you have another patch?

Am I missing something?

(2013/11/28 1:42), Alvaro Herrera wrote:
 > I think I have figured this out.  This code was being too simplistic in
 > that it was only checking whether there was a key-update or not; but
 > that, it seems, is not sufficiently fine-grained.  If we instead think
 > in terms of an already-acquired MultiXactStatus, and a new
 > MultiXactStatus corresponding to the lock we're trying to acquire, we
 > can decide granularly whether each future version of the tuple can be
 > locked by us or not.  And if not, we can decide whether we need to wait
 > on the transaction holding the lock, or fail if it already committed.
 > (There is a funny trick here which is that we represent the held lock
 > with a MultiXactStatus, even if the lock is only a plain Xid and not a
 > multi.  This doesn't seem a problem to me.)
 >
 > So I propose the attached patch.  This doesn't change the behavior
 > codified in the existing isolation tests, and it fixes my reduction of
 > your original test case.  (I haven't run your original test case yet,
 > but I soon will.)
 >
 > Note: I don't quite like that this patch duplicates some code in
 > compute_new_xmax_infomask() which determines the MultiXactStatus from
 > the infomask bits.  Not sure what a good refactoring is, though, because
 > that code just issues a WARNING when the LOCK_ONLY bit is set and no
 > other lockmode is set; whereas the new code issues an ERROR. It seems
 > hard to justify doing otherwise in either place, though; and doing
 > something more complicated doesn't seem warranted for such a corner
 > case.
 >
 > Note: this patch doesn't apply to master in isolation.  You will need
 > the patch I mention in
 > 
http://www.postgresql.org/message-id/20131125201039.GF6597@eldon.alvh.no-ip.org
 > even though I haven't posted it yet.  Will do so shortly.
 >
 >




-- 
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 (11+ messages)  latest in thread

Message-ID: <5296BFE1.2090906@po.ntts.co.jp>
Permalink:  ../5296BFE1.2090906@po.ntts.co.jp/
Also on:    postgresql.org/message-id/5296BFE1.2090906@po.ntts.co.jp

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: katsumata.tomonari@po.ntts.co.jp, alvherre@2ndquadrant.com
  Subject: Re: BUG #8434: Why does dead lock occur many times ?
  In-Reply-To: <5296BFE1.2090906@po.ntts.co.jp>
  References: <E1VH9At-0005VC-Kk@wrigleys.postgresql.org> <20131004172217.GW5235@eldon.alvh.no-ip.org> <20131127164226.GA14522@eldon.alvh.no-ip.org> <5296BFE1.2090906@po.ntts.co.jp>

* 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