pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Schroeder <kschroeder@mirageworks.com>
To: pgsql-admin@postgresql.org
Subject: Transaction log file screwed up
Date: Thu, 22 Apr 2004 08:29:53 -0500
Message-ID: <019d01c4286d$e51c25f0$0200a8c0@WORKSTATION> (raw)

Hello,
    A client database crashed last night and I think I found the solution to
the problem at http://www.varlena.com/varlena/GeneralBits/45.php "Database
Recovery Procedures ".  The solution was to append the file with enough
zeros to get the file size correct.  The solution was to run

dd bs=8k count=1 < /dev/zero >> $PGDATA/pg_clog/0005

which added the zeros to the end.  However my error values are a little
different from ones in the example and the person who posted this noted that
this should NOT be tried haphazardly.  Since I'd rather not crash a client's
database to the point of no recovery I wouldn't mind having someone with
more knowledge of PostgreSQL post the command with the correct arguments to
fix the problem, or tell me I'm off my rocker trying to fix it this way.

Following is pg_ctl's output when trying to start the database.  Following
that is the directory listing for the pg_clog directory.

LOG:  checkpoint record is at 1/383BDFC0
LOG:  redo record is at 1/383BDFC0; undo record is at 0/0; shutdown TRUE
LOG:  next transaction id: 15038948; next oid: 3293693
LOG:  database system was not properly shut down; automatic recovery in
progress
LOG:  ReadRecord: unexpected pageaddr 1/363BE000 in log file 1, segment 56,
offset 3923968
LOG:  redo is not required
PANIC:  XLogWrite: write request 1/383BE000 is past end of log 1/383BE000
LOG:  startup process (pid 1555) was terminated by signal 6
LOG:  aborting startup due to startup process failure

pgsql/data/pg_clog/*

-rw-------    1 postgres  postgres   262144 Mar 14 13:10 0000
-rw-------    1 postgres  postgres    262144 Mar 24 15:35 0001
-rw-------    1 postgres  postgres    262144 Mar 27 00:04 0002
-rw-------    1 postgres  postgres    262144 Mar 29 18:06 0003
-rw-------    1 postgres  postgres    262144 Apr  1 00:39 0004
-rw-------    1 postgres  postgres    262144 Apr  3 09:54 0005
-rw-------    1 postgres  postgres    262144 Apr  5 21:39 0006
-rw-------    1 postgres  postgres    262144 Apr  8 03:26 0007
-rw-------    1 postgres  postgres    262144 Apr 10 10:15 0008
-rw-------    1 postgres  postgres    262144 Apr 12 21:05 0009
-rw-------    1 postgres  postgres    262144 Apr 15 00:32 000A
-rw-------    1 postgres  postgres    262144 Apr 17 03:38 000B
-rw-------    1 postgres  postgres    262144 Apr 19 13:07 000C
-rw-------    1 postgres  postgres    262144 Apr 21 13:38 000D
-rw-------    1 postgres  postgres     90112 Apr 22 07:01 000E

Thanks

Kevin




view thread (2+ messages)  latest in thread

Message-ID: <019d01c4286d$e51c25f0$0200a8c0@WORKSTATION>
Permalink:  ../019d01c4286d$e51c25f0$0200a8c0@WORKSTATION/
Also on:    postgresql.org/message-id/019d01c4286d$e51c25f0$0200a8c0@WORKSTATION

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: kschroeder@mirageworks.com
  Subject: Re: Transaction log file screwed up
  In-Reply-To: <019d01c4286d$e51c25f0$0200a8c0@WORKSTATION>
  References: <019d01c4286d$e51c25f0$0200a8c0@WORKSTATION>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox