Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 9C0C51337BD5 for ; Thu, 3 Mar 2011 04:17:30 -0400 (AST) 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 03921-08; Thu, 3 Mar 2011 08:17:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og114.obsmtp.com (exprod7og114.obsmtp.com [64.18.2.215]) by mail.postgresql.org (Postfix) with ESMTP id E93081337B68; Thu, 3 Mar 2011 04:17:21 -0400 (AST) Received: from source ([209.85.215.42]) (using TLSv1) by exprod7ob114.postini.com ([64.18.6.12]) with SMTP ID DSNKTW9OkUNt6mtU+Z3OQm7IMGmxaOvV+KUT@postini.com; Thu, 03 Mar 2011 00:17:22 PST Received: by ewy1 with SMTP id 1so363715ewy.15 for ; Thu, 03 Mar 2011 00:17:19 -0800 (PST) Received: by 10.213.16.78 with SMTP id n14mr815827eba.99.1299140209244; Thu, 03 Mar 2011 00:16:49 -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 t50sm717840eeh.12.2011.03.03.00.16.46 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 03 Mar 2011 00:16:47 -0800 (PST) Message-ID: <4D6F4E5D.6080507@enterprisedb.com> Date: Thu, 03 Mar 2011 10:16:29 +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: daveg CC: Robert Haas , Greg Stark , David Christensen , Maxim Boguk , Fujii Masao , pgsql-admin@postgresql.org, PostgreSQL-development Subject: Re: [HACKERS] Re: PD_ALL_VISIBLE flag was incorrectly set happend during repeatable vacuum References: <4D2D6A56.9060808@enterprisedb.com> <20110228212832.GH26397@sonic.net> <1B3CCBDD-4AC6-404A-9E26-DB4CA2554228@endpoint.com> <20110303071208.GA4053@sonic.net> In-Reply-To: <20110303071208.GA4053@sonic.net> Content-Type: multipart/mixed; boundary="------------050707090009000309090802" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.2 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3 X-Spam-Level: X-Archive-Number: 201103/28 X-Sequence-Number: 36900 This is a multi-part message in MIME format. --------------050707090009000309090802 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 03.03.2011 09:12, daveg wrote: > Question: what would be the consequence of simply patching out the setting > of this flag? Assuming that the incorrect PD_ALL_VISIBLE flag is the only > problem (big assumption perhaps) then simply never setting it would at least > avoid the possibility of returning wrong answers, presumably at some > performance cost. We possibly could live with that until we get a handle > on the real cause and fix. Yes. With that assumption. If you really want to do that, I would suggest the attached patch instead. This just disables the optimization in seqscans to trust it, so an incorrectly set flag won't affect correctness of query results, but the flag is still set as usual and you still get the warnings so that we can continue to debug the issue. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com --------------050707090009000309090802 Content-Type: text/x-diff; name="dont-trust-all-visible-flag.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="dont-trust-all-visible-flag.patch" diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index 7dcc601..d53aede 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -255,6 +255,11 @@ heapgetpage(HeapScanDesc scan, BlockNumber page) * transaction in the standby. */ all_visible = PageIsAllVisible(dp) && !snapshot->takenDuringRecovery; + /* + * XXX: there seems to be something wrong with the way the flag is set, + * so don't trust it. Remove this when the cause is found. + */ + all_visible = false; for (lineoff = FirstOffsetNumber, lpp = PageGetItemId(dp, lineoff); lineoff <= lines; --------------050707090009000309090802--