Re: How to recover when can't start database

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "L(dot)Boldareva" <pg(at)pierro(dot)dds(dot)nl>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: How to recover when can't start database
Date: 2005-04-01 15:22:53
Message-ID: 6531.1112368973@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"L.Boldareva" <pg(at)pierro(dot)dds(dot)nl> writes:
> LOG: database system was not properly shut down; automatic recovery in
> progress
> LOG: redo starts at 5/6F000ABC
> PANIC: btree_split_redo: lost left sibling
> LOG: startup process (PID 5603) was terminated by signal 6

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. Exactly how did you
get into this state ... was there a system-level crash involved? ISTM
this cannot happen unless the filesystem has dropped data.

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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message L.Boldareva 2005-04-01 15:31:22 Re: How to recover when can't start database
Previous Message Pallav Kalva 2005-04-01 14:56:52 Postgresql.conf setting recommendations for 8.0.1