Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 0B9E3133798E for ; Wed, 20 Apr 2011 11:59:55 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 71487-04 for ; Wed, 20 Apr 2011 14:59:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og102.obsmtp.com (exprod7og102.obsmtp.com [64.18.2.157]) by mail.postgresql.org (Postfix) with ESMTP id 612301337B68 for ; Wed, 20 Apr 2011 11:59:45 -0300 (ADT) Received: from mail-ey0-f179.google.com ([209.85.215.179]) (using TLSv1) by exprod7ob102.postini.com ([64.18.6.12]) with SMTP ID DSNKTa702dmWiZkfZegz583o3E7A2WjCdnuK@postini.com; Wed, 20 Apr 2011 07:59:45 PDT Received: by eyg5 with SMTP id 5so254262eyg.10 for ; Wed, 20 Apr 2011 07:59:36 -0700 (PDT) Received: by 10.14.0.199 with SMTP id 47mr237908eeb.139.1303311575917; Wed, 20 Apr 2011 07:59:35 -0700 (PDT) Received: from [192.168.1.183] (dsl-hkibrasgw2-ff7ac300-240.dhcp.inet.fi [88.195.122.240]) by mx.google.com with ESMTPS id q53sm698413eeh.4.2011.04.20.07.59.33 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 20 Apr 2011 07:59:34 -0700 (PDT) Message-ID: <4DAEF4D4.1030205@enterprisedb.com> Date: Wed, 20 Apr 2011 17:59:32 +0300 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.1.16) Gecko/20110307 Icedove/3.0.11 MIME-Version: 1.0 To: Tom Lane CC: Marko Tiikkaja , pgsql-bugs@postgresql.org, Kevin Grittner Subject: Re: BUG #5989: Assertion failure on UPDATE of big value References: <201104201411.p3KEBOfA009414@wwwmaster.postgresql.org> <26153.1303309604@sss.pgh.pa.us> <4DAEF1D4.2000203@enterprisedb.com> <26601.1303311077@sss.pgh.pa.us> In-Reply-To: <26601.1303311077@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201104/148 X-Sequence-Number: 30067 On 20.04.2011 17:51, Tom Lane wrote: > Heikki Linnakangas writes: >> On 20.04.2011 17:26, Tom Lane wrote: >>> Why is predicate.c getting called at all when transaction_isolation is >>> not SERIALIZABLE? (Although the same crash happens when it is ...) > >> Because another serializable transaction that reads/updates the tuple >> later needs to find the predicate lock acquired by the first >> transaction, even if the transaction in the middle isn't serializable. > > Sorry, that argument doesn't pass the sniff test. If the transaction in > the middle isn't serializable, then it is not the same as the "first > transaction", which means that the first transaction is completed and > can no longer be holding any locks. There's *three* transactions here. The first one is serializable, and reads the tuple. The second one is not serializable, and updates it. The third one is serializable and updates it again. The second transaction needs to copy the predicate lock held by the first transaction to the new row version, so that the third transaction that updates it again sees the lock. Or, we document that any non-serializable updates will break the serialization protection for any other transactions accessing the same rows. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com