Re: [patch] pg_copy - a command for reliable WAL archiving

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, MauMau <maumau307(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [patch] pg_copy - a command for reliable WAL archiving
Date: 2014-08-20 14:27:46
Message-ID: 20140820142746.GK10041@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-08-20 10:19:33 -0400, Tom Lane wrote:
> Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> > On 2014-08-20 09:50:56 -0400, Alvaro Herrera wrote:
> >> Andres Freund wrote:
> >>> Isn't this a solution looking for a problem? We're using tempfiles in
> >>> dozens of other places and I really don't see why this is the place to
> >>> stop doing so. Just copy to <dest>.tmp and move it into place.
>
> >> The issue is what happens if there's a crash while the temp file is in
> >> the middle of being filled.
>
> > The archive command will be be run again a couple seconds and remove the
> > half-filled temp file.
>
> Alternatively, you could use the process PID as part of the temp file
> name; which is probably a good idea anyway.

I think that's actually worse, because nothing will clean up those
unless you explicitly scan for all <whatever>.$pid files, and somehow
kill them.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-08-20 14:36:40 Re: [patch] pg_copy - a command for reliable WAL archiving
Previous Message Tom Lane 2014-08-20 14:19:33 Re: [patch] pg_copy - a command for reliable WAL archiving