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 AANLkTikFEmq3KVtwUXjWKhjObo6NrN+oTLc_LDVmssbG@mail.gmail.com
Whole thread Raw
In response to Re: pg_archivecleanup should remove WAL files also in pg_xlog?  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses 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 5:01 PM, Heikki Linnakangas
<heikki.linnakangas@enterprisedb.com> wrote:
> If the only consequence is that you get some extra WAL files in the archive,
> until pg_archivecleanup runs again, I think we can just live with it.

We might get some extra WAL files also in pg_xlog. Because the WAL
files which don't have .ready/.done file survive two checkpoints after
failover. IOW, though first checkpoint right after failover should remove
those WAL files, they cannot be removed since they don't have .done
file. Then the first checkpoint creates .ready files for them, the archiver
performs bulk-archiving (this would be harm in performance if there
are many such WAL files), and the subsequent checkpoint removes
them.

> But
> don't you have bigger problems when standby tries to archive a file that
> already exists in the archive, because master already archived it? We advise
> to write archive_command so that it fails if the file exists already.

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.

Regards,

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


pgsql-hackers by date:

Previous
From: Greg Smith
Date:
Subject: Re: Instrument checkpoint sync calls
Next
From: Dmitriy Igrishin
Date:
Subject: Re: hstores in pl/python