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 heikki.linnakan...@enterprisedb.com 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

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 the symlink to the

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 t...@sss.pgh.pa.us wrote: Heikki Linnakangas heikki.linnakan...@enterprisedb.com 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

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

2009-06-02 Thread Heikki Linnakangas
Fujii Masao wrote: On Tue, Jun 2, 2009 at 10:21 AM, Tom Lane t...@sss.pgh.pa.us wrote: Fujii Masao masao.fu...@gmail.com 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

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

2009-06-02 Thread Fujii Masao
Hi, On Tue, Jun 2, 2009 at 3:40 PM, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: Fujii Masao wrote: On Tue, Jun 2, 2009 at 10:21 AM, Tom Lane t...@sss.pgh.pa.us wrote: Fujii Masao masao.fu...@gmail.com writes: Yes, the old xlog itself is not used again. But, the *old file*

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 the

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

2009-06-02 Thread Tom Lane
Simon Riggs si...@2ndquadrant.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

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 Heikki Linnakangas
Tom Lane wrote: Simon Riggs si...@2ndquadrant.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;

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

2009-06-02 Thread Tom Lane
Heikki Linnakangas heikki.linnakan...@enterprisedb.com 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

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

2009-06-01 Thread Tom Lane
Fujii Masao masao.fu...@gmail.com 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

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

2009-06-01 Thread Heikki Linnakangas
Tom Lane wrote: Fujii Masao masao.fu...@gmail.com 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

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

2009-06-01 Thread Aidan Van Dyk
* Heikki Linnakangas heikki.linnakan...@enterprisedb.com [090601 10:56]: Tom Lane wrote: Fujii Masao masao.fu...@gmail.com 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

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

2009-06-01 Thread Heikki Linnakangas
Aidan Van Dyk wrote: * Heikki Linnakangas heikki.linnakan...@enterprisedb.com [090601 10:56]: Tom Lane wrote: Fujii Masao masao.fu...@gmail.com 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

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

2009-06-01 Thread Tom Lane
Heikki Linnakangas heikki.linnakan...@enterprisedb.com 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

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 t...@sss.pgh.pa.us wrote: Fujii Masao masao.fu...@gmail.com 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

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

2009-06-01 Thread Tom Lane
Fujii Masao masao.fu...@gmail.com 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

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 t...@sss.pgh.pa.us wrote: Fujii Masao masao.fu...@gmail.com 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

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

2009-06-01 Thread Tom Lane
Fujii Masao masao.fu...@gmail.com 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

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 t...@sss.pgh.pa.us wrote: Fujii Masao masao.fu...@gmail.com 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.

[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