Unable to start postgres in recovery mode.

From: "Dhaval Shah" <dhaval(dot)shah(dot)m(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Unable to start postgres in recovery mode.
Date: 2007-03-20 07:30:06
Message-ID: 565237760703200030q41d94452ic8708b052182b505@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am trying to put my database in recovery mode and I get the following error:

===========
LOG: starting archive recovery
LOG: restore_command = "/myrestore/pg_restore.sh %f %p"
00000001.history pg_xlog/RECOVERYHISTORY
[Main]: Server requested for 00000001.history to be copied to
pg_xlog/RECOVERYHISTORY
[pg_restore::isWALFileReady]: 1 Available WAL Files
[Main]: Request to copy 00000001.history to pg_xlog/RECOVERYHISTORY
[pg_restore]::copyWALFile: Moving
/mybackup/000000010000000000000001.009352E8.backup to
pg_xlog/RECOVERYHISTORY
LOG: restored log file "00000001.history" from archive
FATAL: syntax error in history file: START WAL LOCATION: 0/19352E8
(file 000000010000000000000001)

HINT: Expected a numeric timeline ID.
LOG: startup process (PID 12323) exited with exit code 1
LOG: aborting startup due to startup process failure

===========

In the log above, the logs with [Main] or [pg_restore] is my script
which is called by the recovery.conf.

The postgres server is asking for 00000001.history file and I do not
have that file. All I have is the 0*10*1.009352E8.backup file and
other WAL files starting from 0*10*1. In the above case, I move
0*10*1.009352E8.backup pg_xlog/RECOVERYHISTORY. Note that my backup is
on a staging area and I can therefore move safely.

What am I doing wrong?

If I indicate that I do not have the concerned file by returning error
code 1, I get the following error in the log:

============
LOG: starting archive recovery
LOG: restore_command = "/myrestore/pg_restore.sh %f %p"
00000001.history pg_xlog/RECOVERYHISTORY
[Main]: Server requested for 00000001.history to be copied to
pg_xlog/RECOVERYHISTORY
00000001000000000000004F pg_xlog/RECOVERYXLOG
[Main]: Server requested for 00000001000000000000004F to be copied to
pg_xlog/RECOVERYXLOG
LOG: could not open file "pg_xlog/00000001000000000000004F" (log file
0, segment 79): No such file or directory
LOG: invalid primary checkpoint record
00000001000000000000004F pg_xlog/RECOVERYXLOG
[Main]: Server requested for 00000001000000000000004F to be copied to
pg_xlog/RECOVERYXLOG
LOG: could not open file "pg_xlog/00000001000000000000004F" (log file
0, segment 79): No such file or directory
LOG: invalid secondary checkpoint record
PANIC: could not locate a valid checkpoint record
LOG: startup process (PID 12222) was terminated by signal 6
LOG: aborting startup due to startup process failure
LOG: database system was shut down at 2007-03-19 03:33:05 PDT
==============

So what am I doing wrong here? Any help in the above matter is greatly
appreciated.

Regards
Dhaval

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2007-03-20 07:35:36 Re: Optimizing warm standby. Will this work? [PITR WAL]
Previous Message Jeff Davis 2007-03-20 02:10:47 Re: Reference Type in PostgreSQL