Re: pg_archivecleanup should remove WAL files also in pg_xlog?

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_archivecleanup should remove WAL files also in pg_xlog?
Date: 2010-12-13 15:08:14
Message-ID: AANLkTinVmiPifZdQzmrDRqpEAtVkJkChXLSoSB4886DG@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Dec 13, 2010 at 6:02 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Shigeru HANADA 2010-12-13 15:10:11 Re: SQL/MED - core functionality
Previous Message Pavel Stehule 2010-12-13 15:01:35 Re: hstores in pl/python