From: Jesper Krogh <jesper@krogh.cc>
To: pgsql-admin@postgresql.org
Subject: Untraditional point in time recovery.
Date: Tue, 08 Nov 2011 20:24:39 +0100
Message-ID: <4EB981F7.5040802@krogh.cc> (raw)
Hi List.
I have somehow, come up with a postgresql left in this state..
The database crashed today, needing to do a point in time restore that
should stop today before 10:30. I do have wal-files from today - 7 days
available
and I have a scheduled base backup that runs:
pg_start_backup before and pg_stop backup after, once a week. The
last one being -2 days old and the former being -9 days old.
When inspecting the backup I can see that the former backup had
failed to run "pg_stop_backup" so, the pg_start_backup command
of the -2 base backup has failed.
Can I instruct to postgresql to start from the -2 days base backup and
go back to the last "checkpoint" prior to the backup start form the
transaction logs and apply log from that point up until today?
Normally I would just start by the -9 base and apply wal-log from there, but
I am missing a days worth log-file to do that.
So the situation is:
pg_start_backup was run 9 days ago
pg-dirs was copied 2 days ago
pg_stop_backup was run 2 days ago.
I have now-7days worth of archived logs.
It should be safe to just apply "wal-log" from any state prior to -2
days ago?
Can somehow instruct pg to do just that? And reach consistent state
after that.
Should I manually craft a backup_label file?
thanks.
Jesper .. and yes, I'll make sure that the exitstatus from
pg_start_backup gets propagated
correctly back from now on..
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 using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: jesper@krogh.cc
Subject: Re: Untraditional point in time recovery.
In-Reply-To: <4EB981F7.5040802@krogh.cc>
* 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