pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jon Colverson <pgsql@vcxz.co.uk>
To: pgsql-admin@postgresql.org
Subject: Re: Attempt to re-archive existing WAL logs after restoring from backup
Date: Thu, 31 May 2007 05:58:26 +0100
Message-ID: <465E55F2.2020103@vcxz.co.uk> (raw)
In-Reply-To: <465BA7C5.6080400@vcxz.co.uk>
References: <465BA7C5.6080400@vcxz.co.uk>

Jon Colverson wrote:
> I've been testing my DB backup and restore procedure and I've run into 
> something I can't figure out. After recovering from a PITR backup, when 
> I do another pg_start_backup PostgreSQL attempts to re-archive the last 
> log again, which fails because it already exists in the archive.

Hello again. I've been investigating this some more and I've got some 
more details to add:

In xlog.c, exitArchiveRecovery() moves the last restored log file into 
XLOGDIR.

Later (when shutting down the cluster, for instance), 
XLogArchiveCheckDone() is called on the log file. This function looks 
for a ".done" or ".ready" file and finds neither, so it calls 
XLogArchiveNotify() to create the ".ready" file. This causes the 
archiver to come along later and attempt to archive the log and this 
fails because the log already exists in the archive (that's where it 
came from).

So, I think the problem is that exitArchiveRecovery() should be marking 
the restored log file as ".done" (or perhaps not bothering to restore 
the log file at all?).

This looks like a bug to me. Any thoughts?

-- 
Jon



view thread (7+ messages)  latest in thread

Message-ID: <465E55F2.2020103@vcxz.co.uk>
Permalink:  ../465E55F2.2020103@vcxz.co.uk/
Also on:    postgresql.org/message-id/465E55F2.2020103@vcxz.co.uk

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: pgsql@vcxz.co.uk
  Subject: Re: Attempt to re-archive existing WAL logs after restoring from backup
  In-Reply-To: <465E55F2.2020103@vcxz.co.uk>

* 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