Skip site navigation (1) Skip section navigation (2)

Searching for a supposedly resolved bug report

From: Scott Eade <seade(at)backstagetech(dot)com(dot)au>
To: pgsql-admin(at)postgresql(dot)org
Subject: Searching for a supposedly resolved bug report
Date: 2005-09-21 06:47:02
Message-ID: 433101E6.9080900@backstagetech.com.au (view raw or flat)
Thread:
Lists: pgsql-admin
Environment: PostgreSQL 7.3.10-RH, RHEL3

As a result of a failed pg_restore (why it failed will be the subject of
another post) I ended up with a corrupted database (since dropped).

Somehow this resulted in postmaster crashing thus:

    PANIC: open of /var/lib/pgsql/data/pg_clog/0058 failed: No such file
or directory

Sure enough this file does not exist, the file in the pg_clog dir is
0060 (180224 bytes)

I mentioned this on the postgres irc channel, I have included the advice
provided by neilc below:

I am wondering if anyone can point me to the supposedly fixed bug that
would have caused this (is it just me or is it difficult to find
specific bugs using the mailing list - is there an issue tracker
somewhere?)  It would be nice to know how to avoid this in the future.

I am also interested in comments on the suggested solution.  I won't be
able to upgrade to a newer release for a couple of weeks, and then it
will only be to 7.4.x.  Is the suggested solution going to allow me to
continue using the databases (i.e. moving forward past the ability to
run a dump).

Thanks in advance for any comments.

Scott


=== Edited irc transcript below ===

neilc> hmm, i thought the fix for this was backported to 7.3.10
> but perhaps not in any case, this is a fairly serious bug
> that has been fixed in recent PG releases so i would
> recommend upgrading (e.g. to 8.0.3) once you've fixed the
> problem
> to fix the problem (i.e.allow pg_dump so you can upgrade),
> recreate the clog files
> they should be all-zeroes
> so use dd if=/dev/zero of=/the/file/in/clog
> the length should be a multiple of 8192
> basically, create a zero-length file
> PG will then complain it can't find any data at a particular offset
> then extend the file (with all-zeroes) to the offset PG complains
> about

Worryingly, someone else commented
> i'm thinking it could be prefaced with WARNING! YOU ARE ABOUT TO
DESTROY DATA! THIS IS THE LAST RESORT!

seade> I assume I need to drop postmaster before I do the
seade> dd if=/dev/zero of=/the/file/in/clog?
seade> what about the filename 0060 will this be tidied up
seade> too on restart?
neilc> seade: yeah, stop the postmaster first
neilc> seade: the filename is fine



Responses

pgsql-admin by date

Next:From: Magnus HaganderDate: 2005-09-21 07:19:18
Subject: Re: postgresql cluster on SAN
Previous:From: Chris TraversDate: 2005-09-21 06:33:14
Subject: Re: postgresql cluster on SAN

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group