Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 1F0121337BE7 for ; Fri, 4 Mar 2011 16:42:53 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 63801-08 for ; Fri, 4 Mar 2011 20:42:44 +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 ED2621337BE5 for ; Fri, 4 Mar 2011 16:42:41 -0400 (AST) Received: from source ([209.85.215.179]) (using TLSv1) by exprod7ob101.postini.com ([64.18.6.12]) with SMTP ID DSNKTXFOwDQe2q15zthYfmaud5aIAIlg/rEI@postini.com; Fri, 04 Mar 2011 12:42:42 PST Received: by mail-ey0-f179.google.com with SMTP id 5so866807eyg.24 for ; Fri, 04 Mar 2011 12:42:40 -0800 (PST) Received: by 10.213.29.210 with SMTP id r18mr755821ebc.36.1299271359572; Fri, 04 Mar 2011 12:42:39 -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 t50sm2225286eeh.12.2011.03.04.12.42.37 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Mar 2011 12:42:38 -0800 (PST) Message-ID: <4D714EBD.9020409@enterprisedb.com> Date: Fri, 04 Mar 2011 22:42:37 +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: Kevin Grittner CC: YAMAMOTO Takashi , pgsql-bugs@postgresql.org Subject: Re: BUG #5915: OldSerXidAdd inflates pg_serial too much References: <201103041241.p24CfDZV063217@wwwmaster.postgresql.org> <4D70E897020000250003B4B8@gw.wicourts.gov> <4D714A6B.3030506@enterprisedb.com> <4D70F844020000250003B4C0@gw.wicourts.gov> In-Reply-To: <4D70F844020000250003B4C0@gw.wicourts.gov> 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/111 X-Sequence-Number: 29621 On 04.03.2011 22:33, Kevin Grittner wrote: > Heikki Linnakangas wrote: > >> Hmm, if I'm reading that function correctly, it makes sure that >> when headPage< 0 (which implies that the SLRU has not been used >> since startup, right? ) > > No, look at the bottom of OldSerXidSetActiveSerXmin() -- cleanup of > segments is done incrementally, but when it finds it has cleaned up > *everything* it sets headPage = -1. I believe that should only > happen when the xmin has moved past the end of the segment. > >> it zeroes out the whole SLRU file, not only the currently active >> region. > > That's not the intent. If it's doing that, it's accidental. It is > trying to zero from the start of a segment, if a new one is needed. Sorry, I was not entirely clear. It clears all pages from the start of the segment, up to the last currently active page, even if the active region from tailXid to headXid only spans a couple of pages somewhere in the middle of the segment. It seems pointless to clear the pages in the beginning of the segment in that case. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com