Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WqMs8-0000yK-HY for pgsql-bugs@arkaria.postgresql.org; Fri, 30 May 2014 13:29:24 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WqMs7-00057I-91 for pgsql-bugs@arkaria.postgresql.org; Fri, 30 May 2014 13:29:23 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1WqMs6-00057A-6x for pgsql-bugs@postgresql.org; Fri, 30 May 2014 13:29:22 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1WqMs1-0003Dt-TF for pgsql-bugs@postgresql.org; Fri, 30 May 2014 13:29:20 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1WqMs0-0004ej-HI; Fri, 30 May 2014 09:29:16 -0400 Date: Fri, 30 May 2014 09:29:16 -0400 From: Bruce Momjian To: Andres Freund Cc: PostgreSQL Bugs , Alvaro Herrera Subject: Re: pg_upgrade < 9.3 -> >=9.3 misses a step around multixacts Message-ID: <20140530132916.GM28490@momjian.us> References: <20140530121631.GE25431@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140530121631.GE25431@alap3.anarazel.de> User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On Fri, May 30, 2014 at 02:16:31PM +0200, Andres Freund wrote: > Hi, > > When upgrading a < 9.3 cluster pg_upgrade doesn't bother to keep the old > multixacts around because they won't be read after the upgrade (and > aren't compatible). It just resets the new cluster's nextMulti to the > old + 1. > Unfortunately that means that there'll be a offsets/0000 file created by > initdb around. Sounds harmless enough, but that'll actually cause > problems if the old cluster had a nextMulti that's bigger than that > page. > > When vac_truncate_clog() calls TruncateMultiXact() that'll scan > pg_multixact/offsets to find the earliest existing segment. That'll be > 0000. If the to-be-truncated data is older than the last existing > segment it returns. Then it'll try to determine the last required data > in members/ by accessing the oldest data in offsets/. > > Unfortunately, due to the existing 0000/ segment, that means it'll > sometimes try to access a nonexistant offsets/ file. Preventing vacuum > et al from succeeding. > > > It seems to me the fix for this is to a) rmtree("pg_multixact/members", > false) in copy_clog_xlog_xid() in the oldcluster < 9.3 case b) add a > warning to the release notes that everyone that used pg_upgrade and has > a 0000 file lying around should report to the mailinglist. > > b) is a bit unsatisfactory, but I don't want to suggest removing the > file. In too many situations it might actually still be needed. This is a bug in 9.3 pg_upgrade as well? Why has no one reported it before? -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + Everyone has their own god. + -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs