Re: pg_standby -l might destory the archived file - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: pg_standby -l might destory the archived file
Date
Msg-id 1243959190.23910.81.camel@ebony.2ndQuadrant
Whole thread Raw
In response to pg_standby -l might destory the archived file  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: pg_standby -l might destory the archived file  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: pg_standby -l might destory the archived file  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
On Mon, 2009-06-01 at 14:47 +0900, Fujii Masao wrote:

> pg_standby can use ln command to restore an archived file,
> which might destroy the archived file as follows.
> 
> 1) pg_standby creates the symlink to the archived file '102'
> 2) '102' is applied
> 3) the next file '103' doesn't exist and the trigger file is created
> 4) '102' is re-fetched
> 5) at the end of recovery, the symlink to '102' is rename to '202',
>     but it still points '102'
> 6) after recovery, '202' is recycled (rename to '208', which still
>     points '102')
> 7) '208' is written new xlog records over
>     --> the archived file '102' comes down!
> 
> One simple solution to fix this problem...

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.

General comment on thread: What's going on with all these "fixes"?
Anybody reading the commit log and/or weekly news is going to get fairly
worried for no reason at all. For that reason I ask for longer
consideration and wider discussion before committing something - it
would certainly avoid lengthy post commit discussion as has occurred
twice recently. I see no reason for such haste on these "fixes". If
there's a need for haste, ship them to your customers directly, please
don't scare other people's. 

-- Simon Riggs           www.2ndQuadrant.comPostgreSQL Training, Services and Support



pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: Managing multiple branches in git
Next
From: Alvaro Herrera
Date:
Subject: Re: Managing multiple branches in git