Re: pg_archivecleanup should remove WAL files also in pg_xlog? - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: pg_archivecleanup should remove WAL files also in pg_xlog?
Date
Msg-id AANLkTinVmiPifZdQzmrDRqpEAtVkJkChXLSoSB4886DG@mail.gmail.com
Whole thread Raw
In response to Re: pg_archivecleanup should remove WAL files also in pg_xlog?  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
On Mon, Dec 13, 2010 at 6:02 PM, Fujii Masao <masao.fujii@gmail.com> wrote:
> Yep, that's recommended in the document, but I don't want to use that.
> Because that might make new master fail to archive WAL file because of
> existence of half-baked file in the archive, after failover. This can happen
> if the master crashes while its archiver is copying WAL file.

This occurred to me that archive_command should check the size of the
existing archived WAL file, and overwrite it with new file when the size is
not equal to 16MB. Of course, if backup history file or timeline history file
is given, it should not take account of the file size.

I implemented pg_archivecopy module to do the above.
git://git.postgresql.org/git/users/fujii/postgres.git
branch: pg_archivecopy

If it's worth, I'll release it in pgFoundry or elsewhere.

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: hstores in pl/python
Next
From: Shigeru HANADA
Date:
Subject: Re: SQL/MED - core functionality