Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 442AE1336971 for ; Tue, 1 Mar 2011 13:07:56 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 69954-08 for ; Tue, 1 Mar 2011 17:07:48 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og101.obsmtp.com (exprod7og101.obsmtp.com [64.18.2.155]) by mail.postgresql.org (Postfix) with ESMTP id 1F88A1337B96 for ; Tue, 1 Mar 2011 13:07:47 -0400 (AST) Received: from source ([209.85.215.49]) (using TLSv1) by exprod7ob101.postini.com ([64.18.6.12]) with SMTP ID DSNKTW0n4qnnnMWwNU9KYifgJuqvSZlMj7vb@postini.com; Tue, 01 Mar 2011 09:07:48 PST Received: by mail-ew0-f49.google.com with SMTP id 23so1682823ewy.36 for ; Tue, 01 Mar 2011 09:07:46 -0800 (PST) Received: by 10.213.20.73 with SMTP id e9mr4318584ebb.39.1298999266301; Tue, 01 Mar 2011 09:07:46 -0800 (PST) Received: from [192.168.1.183] (dsl-hkibrasgw2-ff7ac300-240.dhcp.inet.fi [88.195.122.240]) by mx.google.com with ESMTPS id q53sm669388eeh.4.2011.03.01.09.07.43 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 01 Mar 2011 09:07:44 -0800 (PST) Message-ID: <4D6D27DE.8080304@enterprisedb.com> Date: Tue, 01 Mar 2011 19:07:42 +0200 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.1.16) Gecko/20101226 Icedove/3.0.11 MIME-Version: 1.0 To: Dan Ports CC: PostgreSQL-development Subject: Re: SSI bug? References: <4D616C14020000250003AD9A@gw.wicourts.gov> <20110221234236.4635E19D574@mail.netbsd.org> <20110222024129.GC74913@csail.mit.edu> <4D639519020000250003AE0D@gw.wicourts.gov> <20110222232054.GC61128@csail.mit.edu> <20110301000306.GL10115@csail.mit.edu> In-Reply-To: <20110301000306.GL10115@csail.mit.edu> 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=-4.2 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3 X-Spam-Level: X-Archive-Number: 201103/37 X-Sequence-Number: 183287 On 01.03.2011 02:03, Dan Ports wrote: > An updated patch to address this issue is attached. It fixes a couple > issues related to use of the backend-local lock table hint: > > - CheckSingleTargetForConflictsIn now correctly handles the case > where a lock that's being held is not reflected in the local lock > table. This fixes the assertion failure reported in this thread. > > - PredicateLockPageCombine now retains locks for the page that is > being removed, rather than removing them. This prevents a > potentially dangerous false-positive inconsistency where the local > lock table believes that a lock is held, but it is actually not. > > - add some more comments documenting the times when the local lock > table can be inconsistent with reality, as reflected in the shared > memory table. > > This patch also incorporates Kevin's changes to copy locks when > creating a new version of a tuple rather than trying to maintain a > linkage between different versions. So this is a patch that should > apply against HEAD and addresses all outstanding SSI bugs known to > Kevin or myself. Thanks, committed with minor changes. The ordering of the fields in PREDICATELOCKTAG was bizarre, so I just expanded the offsetnumber fields to an uint32, instead of having the padding field. I think that's a lot more readable. I also added an optimization in PredicateLockTupleRowVersionLink() to not try to transfer the page locks, if the new tuple is on the same page as the old one. That's very cheap to check, and it's very common for an update to stay within a page. Was there test cases for any of the issues fixed by this patch that we should add to the suite? -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com