Re: [HACKERS] Unarchived WALs deleted after crash

2013-02-21 Thread Heikki Linnakangas
On 21.02.2013 02:59, Daniel Farina wrote: On Fri, Feb 15, 2013 at 9:29 AM, Simon Riggssi...@2ndquadrant.com wrote: On 15 February 2013 17:07, Heikki Linnakangashlinnakan...@vmware.com wrote: Unfortunately in HEAD, xxx.done file is not created when restoring archived file because of absence

Re: [HACKERS] Unarchived WALs deleted after crash

2013-02-21 Thread Daniel Farina
On Thu, Feb 21, 2013 at 12:39 AM, Heikki Linnakangas hlinnakan...@vmware.com wrote: On 21.02.2013 02:59, Daniel Farina wrote: On Fri, Feb 15, 2013 at 9:29 AM, Simon Riggssi...@2ndquadrant.com wrote: On 15 February 2013 17:07, Heikki Linnakangashlinnakan...@vmware.com wrote: Unfortunately

Re: [HACKERS] Unarchived WALs deleted after crash

2013-02-21 Thread Jeff Janes
On Thu, Feb 21, 2013 at 12:39 AM, Heikki Linnakangas hlinnakan...@vmware.com wrote: Are you talking about the patch to avoid restored WAL segments from being re-archived (commit 6f4b8a4f4f7a2d683ff79ab59d3693714b965e3d), or the bug that that unarchived WALs were deleted after crash (commit

Re: [HACKERS] Unarchived WALs deleted after crash

2013-02-20 Thread Jehan-Guillaume de Rorthais
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Just a quick top-post to thank you all for this fix guys ! Cheers, On 15/02/2013 18:43, Heikki Linnakangas wrote: On 15.02.2013 19:16, Fujii Masao wrote: On Sat, Feb 16, 2013 at 2:07 AM, Heikki Linnakangas hlinnakan...@vmware.com wrote: On

Re: [HACKERS] Unarchived WALs deleted after crash

2013-02-20 Thread Daniel Farina
On Fri, Feb 15, 2013 at 9:29 AM, Simon Riggs si...@2ndquadrant.com wrote: On 15 February 2013 17:07, Heikki Linnakangas hlinnakan...@vmware.com wrote: Unfortunately in HEAD, xxx.done file is not created when restoring archived file because of absence of the patch. We need to implement that

Re: [HACKERS] Unarchived WALs deleted after crash

2013-02-15 Thread Heikki Linnakangas
On 14.02.2013 17:45, Jehan-Guillaume de Rorthais wrote: I am facing an unexpected behavior on a 9.2.2 cluster that I can reproduce on current HEAD. On a cluster with archive enabled but failing, after a crash of postmaster, the checkpoint occurring before leaving the recovery mode deletes any

Re: [HACKERS] Unarchived WALs deleted after crash

2013-02-15 Thread Simon Riggs
On 15 February 2013 14:31, Heikki Linnakangas hlinnakan...@vmware.com wrote: On 14.02.2013 17:45, Jehan-Guillaume de Rorthais wrote: I am facing an unexpected behavior on a 9.2.2 cluster that I can reproduce on current HEAD. On a cluster with archive enabled but failing, after a crash of

Re: [HACKERS] Unarchived WALs deleted after crash

2013-02-15 Thread Heikki Linnakangas
On 15.02.2013 17:12, Simon Riggs wrote: On 15 February 2013 14:31, Heikki Linnakangashlinnakan...@vmware.com wrote: - /* - * Normally we don't delete old XLOG files during recovery to - * avoid accidentally deleting a file that looks stale due to a - * bug or hardware issue, but in fact

Re: [HACKERS] Unarchived WALs deleted after crash

2013-02-15 Thread Fujii Masao
On Fri, Feb 15, 2013 at 11:31 PM, Heikki Linnakangas hlinnakan...@vmware.com wrote: On 14.02.2013 17:45, Jehan-Guillaume de Rorthais wrote: I am facing an unexpected behavior on a 9.2.2 cluster that I can reproduce on current HEAD. On a cluster with archive enabled but failing, after a crash

Re: [HACKERS] Unarchived WALs deleted after crash

2013-02-15 Thread Heikki Linnakangas
On 15.02.2013 18:10, Fujii Masao wrote: On Fri, Feb 15, 2013 at 11:31 PM, Heikki Linnakangas hlinnakan...@vmware.com wrote: - /* - * Normally we don't delete old XLOG files during recovery to - * avoid accidentally deleting a file that looks stale due to a - * bug or hardware issue, but

Re: [HACKERS] Unarchived WALs deleted after crash

2013-02-15 Thread Fujii Masao
On Sat, Feb 16, 2013 at 2:07 AM, Heikki Linnakangas hlinnakan...@vmware.com wrote: On 15.02.2013 18:10, Fujii Masao wrote: On Fri, Feb 15, 2013 at 11:31 PM, Heikki Linnakangas hlinnakan...@vmware.com wrote: - /* - * Normally we don't delete old XLOG files during recovery to - *

Re: [HACKERS] Unarchived WALs deleted after crash

2013-02-15 Thread Simon Riggs
On 15 February 2013 17:07, Heikki Linnakangas hlinnakan...@vmware.com wrote: Unfortunately in HEAD, xxx.done file is not created when restoring archived file because of absence of the patch. We need to implement that first. Ah yeah, that thing again..

Re: [HACKERS] Unarchived WALs deleted after crash

2013-02-15 Thread Heikki Linnakangas
On 15.02.2013 19:16, Fujii Masao wrote: On Sat, Feb 16, 2013 at 2:07 AM, Heikki Linnakangas hlinnakan...@vmware.com wrote: On 15.02.2013 18:10, Fujii Masao wrote: At least in 9.2, when the archived file is restored into pg_xlog, its xxx.done archive status file is created. So we don't need

Re: [HACKERS] Unarchived WALs deleted after crash

2013-02-15 Thread Simon Riggs
On 15 February 2013 16:10, Fujii Masao masao.fu...@gmail.com wrote: I propose the attached patch to fix it. At least in 9.2, when the archived file is restored into pg_xlog, its xxx.done archive status file is created. So we don't need to check InArchiveRecovery when deleting old WAL files.

[HACKERS] Unarchived WALs deleted after crash

2013-02-14 Thread Jehan-Guillaume de Rorthais
Hi, I am facing an unexpected behavior on a 9.2.2 cluster that I can reproduce on current HEAD. On a cluster with archive enabled but failing, after a crash of postmaster, the checkpoint occurring before leaving the recovery mode deletes any additional WALs, even those waiting to be archived.

Re: [HACKERS] Unarchived WALs deleted after crash

2013-02-14 Thread Daniel Farina
On Thu, Feb 14, 2013 at 7:45 AM, Jehan-Guillaume de Rorthais j...@dalibo.com wrote: Hi, I am facing an unexpected behavior on a 9.2.2 cluster that I can reproduce on current HEAD. On a cluster with archive enabled but failing, after a crash of postmaster, the checkpoint occurring before