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

Re: Attempt to re-archive existing WAL logs after restoring from backup

From: Jon Colverson <pgsql(at)vcxz(dot)co(dot)uk>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Attempt to re-archive existing WAL logs after restoring from backup
Date: 2007-05-31 04:58:26
Message-ID: 465E55F2.2020103@vcxz.co.uk (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-hackers
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

In response to

Responses

pgsql-hackers by date

Next:From: Zoltan BoszormenyiDate: 2007-05-31 05:31:48
Subject: Re: New cast between inet/cidr and bytea
Previous:From: OmniPay CompanyDate: 2007-05-31 02:42:41
Subject: Job Proposal

pgsql-admin by date

Next:From: adeyDate: 2007-05-31 05:30:20
Subject: Re: High Avaliable in the PostgreSQL.
Previous:From: Andrew SullivanDate: 2007-05-30 22:26:57
Subject: Re: High Avaliable in the PostgreSQL.

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