Re: [HACKERS] pg_standby -l might destory the archived file

2009-06-04 Thread Simon Riggs
On Tue, 2009-06-02 at 19:43 +0300, Heikki Linnakangas wrote: > Simon Riggs wrote: > > 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 th

Re: [HACKERS] pg_standby -l might destory the archived file

2009-06-04 Thread Simon Riggs
On Tue, 2009-06-02 at 14:54 -0400, Tom Lane wrote: > Heikki Linnakangas writes: > > Tom Lane wrote: > >> 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

Re: [HACKERS] pg_standby -l might destory the archived file

2009-06-03 Thread Fujii Masao
Hi, On Wed, Jun 3, 2009 at 3:54 AM, Tom Lane wrote: > Heikki Linnakangas writes: >> Tom Lane wrote: >>> 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

Re: [HACKERS] pg_standby -l might destory the archived file

2009-06-02 Thread Tom Lane
Heikki Linnakangas writes: > Tom Lane wrote: >> 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 00010057 or similar > at the end of recovery,

Re: [HACKERS] pg_standby -l might destory the archived file

2009-06-02 Thread Heikki Linnakangas
Tom Lane wrote: Simon Riggs 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 und

Re: [HACKERS] pg_standby -l might destory the archived file

2009-06-02 Thread Heikki Linnakangas
Simon Riggs wrote: 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

Re: [HACKERS] pg_standby -l might destory the archived file

2009-06-02 Thread Tom Lane
Simon Riggs 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

Re: [HACKERS] pg_standby -l might destory the archived file

2009-06-02 Thread Simon Riggs
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

Re: [HACKERS] pg_standby -l might destory the archived file

2009-06-01 Thread Fujii Masao
Hi, On Tue, Jun 2, 2009 at 3:40 PM, Heikki Linnakangas wrote: > Fujii Masao wrote: >> >> On Tue, Jun 2, 2009 at 10:21 AM, Tom Lane wrote: >>> >>> Fujii Masao writes: Yes, the old xlog itself is not used again. But, the *old file* might be recycled and used later. The case that I'

Re: [HACKERS] pg_standby -l might destory the archived file

2009-06-01 Thread Heikki Linnakangas
Fujii Masao wrote: On Tue, Jun 2, 2009 at 10:21 AM, Tom Lane wrote: Fujii Masao writes: Yes, the old xlog itself is not used again. But, the *old file* might be recycled and used later. The case that I'm looking at is that the symlink to a temporary area is recycled. Am I missing something?

Re: [HACKERS] pg_standby -l might destory the archived file

2009-06-01 Thread Fujii Masao
Hi, On Tue, Jun 2, 2009 at 10:21 AM, Tom Lane wrote: > Fujii Masao writes: >> Yes, the old xlog itself is not used again. But, the *old file* might >> be recycled and used later. The case that I'm looking at is that the >> symlink to a temporary area is recycled. Am I missing something? > > Actu

Re: [HACKERS] pg_standby -l might destory the archived file

2009-06-01 Thread Tom Lane
Fujii Masao writes: > Yes, the old xlog itself is not used again. But, the *old file* might > be recycled and used later. The case that I'm looking at is that the > symlink to a temporary area is recycled. Am I missing something? Actually, I think the right fix for that would be to add defenses t

Re: [HACKERS] pg_standby -l might destory the archived file

2009-06-01 Thread Fujii Masao
Hi, On Tue, Jun 2, 2009 at 10:00 AM, Tom Lane wrote: > Fujii Masao writes: >> If so, it might be deleted after triggering the warm-standby. But, we cannot >> remove it because the latest xlog file which is required for normal recovery >> might exist in it. This is another undesirable scenario. I

Re: [HACKERS] pg_standby -l might destory the archived file

2009-06-01 Thread Tom Lane
Fujii Masao writes: > If so, it might be deleted after triggering the warm-standby. But, we cannot > remove it because the latest xlog file which is required for normal recovery > might exist in it. This is another undesirable scenario. Is this problem? What recovery? In the problem case you're

Re: [HACKERS] pg_standby -l might destory the archived file

2009-06-01 Thread Fujii Masao
Hi, On Mon, Jun 1, 2009 at 11:41 PM, Tom Lane wrote: > Fujii Masao writes: >> pg_standby can use ln command to restore an archived file, >> which might destroy the archived file as follows. > > Does it matter?  pg_standby's source area wouldn't normally be an > "archive" in the real sense of the

Re: [HACKERS] pg_standby -l might destory the archived file

2009-06-01 Thread Tom Lane
Heikki Linnakangas writes: > I wonder if we should just remove the symlink option from pg_standby. I was considering suggesting that too... regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: htt

Re: [HACKERS] pg_standby -l might destory the archived file

2009-06-01 Thread Heikki Linnakangas
Aidan Van Dyk wrote: * Heikki Linnakangas [090601 10:56]: Tom Lane wrote: Fujii Masao writes: pg_standby can use ln command to restore an archived file, which might destroy the archived file as follows. Does it matter? pg_standby's source area wouldn't normally be an "archive" in the real

Re: [HACKERS] pg_standby -l might destory the archived file

2009-06-01 Thread Aidan Van Dyk
* Heikki Linnakangas [090601 10:56]: > Tom Lane wrote: >> Fujii Masao writes: >>> pg_standby can use ln command to restore an archived file, >>> which might destroy the archived file as follows. >> >> Does it matter? pg_standby's source area wouldn't normally be an >> "archive" in the real sense

Re: [HACKERS] pg_standby -l might destory the archived file

2009-06-01 Thread Heikki Linnakangas
Tom Lane wrote: Fujii Masao writes: pg_standby can use ln command to restore an archived file, which might destroy the archived file as follows. Does it matter? pg_standby's source area wouldn't normally be an "archive" in the real sense of the word, it's just a temporary staging area betwee

Re: [HACKERS] pg_standby -l might destory the archived file

2009-06-01 Thread Tom Lane
Fujii Masao writes: > pg_standby can use ln command to restore an archived file, > which might destroy the archived file as follows. Does it matter? pg_standby's source area wouldn't normally be an "archive" in the real sense of the word, it's just a temporary staging area between master and sla

[HACKERS] pg_standby -l might destory the archived file

2009-05-31 Thread Fujii Masao
Hi, 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 e