Re: [HACKERS] Unarchived WALs deleted after crash

2013-02-21 Thread Jeff Janes
On Thu, Feb 21, 2013 at 12:39 AM, Heikki Linnakangas 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 > b5ec56f664fa20d80fe75

Re: [HACKERS] Unarchived WALs deleted after crash

2013-02-21 Thread Daniel Farina
On Thu, Feb 21, 2013 at 12:39 AM, Heikki Linnakangas wrote: > On 21.02.2013 02:59, Daniel Farina wrote: >> >> On Fri, Feb 15, 2013 at 9:29 AM, Simon Riggs >> wrote: >>> >>> On 15 February 2013 17:07, Heikki Linnakangas >>> wrote: >>> > Unfortunately in HEAD, xxx.done file is not created when r

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 Riggs wrote: On 15 February 2013 17:07, Heikki Linnakangas 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

Re: [HACKERS] Unarchived WALs deleted after crash

2013-02-20 Thread Daniel Farina
On Fri, Feb 15, 2013 at 9:29 AM, Simon Riggs wrote: > On 15 February 2013 17:07, Heikki Linnakangas 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

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 >> wrote: >>> On 15.02.2013 18:10, F

Re: [HACKERS] Unarchived WALs deleted after crash

2013-02-15 Thread Simon Riggs
On 15 February 2013 16:10, Fujii Masao 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. Checking whether

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 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 to check InArchiveRecover

Re: [HACKERS] Unarchived WALs deleted after crash

2013-02-15 Thread Simon Riggs
On 15 February 2013 17:07, Heikki Linnakangas 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.. > (http://www.postgresql.org/message-id/50df5ba7.6070.

Re: [HACKERS] Unarchived WALs deleted after crash

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

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 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 contains import

Re: [HACKERS] Unarchived WALs deleted after crash

2013-02-15 Thread Fujii Masao
On Fri, Feb 15, 2013 at 11:31 PM, Heikki Linnakangas 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 >> postma

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 Linnakangas 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 contains important data

Re: [HACKERS] Unarchived WALs deleted after crash

2013-02-15 Thread Simon Riggs
On 15 February 2013 14:31, Heikki Linnakangas 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 >> postmaster, t

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 ad

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 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 leaving the