Re: pg_standby -l might destory the archived file

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Simon Riggs <simon(at)2ndQuadrant(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_standby -l might destory the archived file
Date: 2009-06-02 17:18:46
Message-ID: 4A255EF6.5050001@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Simon Riggs <simon(at)2ndQuadrant(dot)com> writes:
>> err...I don't see *any* problem at all, since pg_standby does not do
>> step (1) in the way you say and therefore never does step (5). Any links
>> created are explicitly deleted in all cases at the end of recovery.
>
> That's a good point; don't we recover files under names like
> RECOVERYXLOG, not under names that could possibly conflict with regular
> WAL files?

Yes. But we rename RECOVERYXLOG to 000000010000000000000057 or similar
at the end of recovery, in exitArchiveRecovery().

Thinking about this some more, I think we should've changed
exitArchiveRecovery() rather than RemoveOldXlogFiles(): it would be more
robust if exitArchiveRecovery() always copied the last WAL file rather
than just renamed it. It doesn't seem safe to rely on the file the
symlink points to to be valid after recovery is finished, and we might
write to it before it's recycled, so the current fix isn't complete.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2009-06-02 17:24:14 Re: Managing multiple branches in git
Previous Message Aidan Van Dyk 2009-06-02 17:11:19 Re: Managing multiple branches in git