X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 00F3C53BB1 for ; Fri, 1 Apr 2005 16:57:55 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 71573-07 for ; Fri, 1 Apr 2005 15:57:48 +0000 (GMT) Received: from otto2.isd-holland.nl (otto.isd-holland.nl [62.221.254.21]) by svr1.postgresql.org (Postfix) with ESMTP id DF6AF53352 for ; Fri, 1 Apr 2005 16:57:47 +0100 (BST) Received: from shell.dds.nl (shell.dds.nl [213.196.11.31]) by otto2.isd-holland.nl (Postfix) with ESMTP id 9B32A364057; Fri, 1 Apr 2005 17:57:51 +0200 (CEST) Date: Fri, 1 Apr 2005 17:57:55 +0200 (CEST) From: "L.Boldareva" X-X-Sender: pierro@yafa.dds.nl To: Tom Lane Cc: pgsql-admin@postgresql.org Subject: Re: How to recover when can't start database In-Reply-To: <6531.1112368973@sss.pgh.pa.us> Message-ID: References: <6531.1112368973@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Archive-Number: 200504/16 X-Sequence-Number: 17029 I have kind of fixed the problem (hopefully) I turned out I used plan B, dump/reload will be my next step then. What is meant by the "corrupt data", is this about the data or the things around it, like indexes, system tables? Here is how I got it crashed: I compiled a c-procedure and copied the .so file to its place exactly at a time when (quite unfortunately) another query was running, that used that library. I usually do pg_ctl reload right after that, and it seems to be enough, but not this time. The c-function contained code that would send a query to populate a table (most likely one of the 2 bad ones), but I am not sure this matters since there were 2 tables out of order, and only one at a time is touched by my script. That's it. I just checked, if that matters, that fsync = true on the config file. On Fri, 1 Apr 2005, Tom Lane wrote: > Hmm. AFAICS that could only happen if a page split record is pointing > at an "original" page that's not there anymore; that is, the page is > past what the kernel says is the end of the file. Something like that was mentioned in the WARNING message when I tried to drop the table, but I got that warning only once, further actions just raised the error about relid. Thank you for your help, LB > You could probably get it to start by changing the "false" to "true" > in this call of XLogReadBuffer > > /* Left (original) sibling */ > buffer = XLogReadBuffer(false, reln, leftsib); > if (!BufferIsValid(buffer)) > elog(PANIC, "btree_split_%s: lost left sibling", op); > > in src/backend/access/nbtree/nbtxlog.c (it's line 261 in CVS tip, > possibly a little different in 8.0). Let us know if that helps. > > I'd be a bit suspicious of the contents of the index, if not the > whole database, so an immediate dump,reinitdb,reload might be your > most prudent course of action after you get it to start. > > Plan B would be to wipe out the WAL log with pg_resetxlog. This will > allow you to start but the odds of having corrupt data afterwards would > be about 100% ... you *must* dump and reload if you go that way. > > regards, tom lane >