Re: [patch] pg_copy - a command for reliable WAL archiving - Mailing list pgsql-hackers

From Greg Stark
Subject Re: [patch] pg_copy - a command for reliable WAL archiving
Date
Msg-id CAM-w4HMdnAEZerVKeSV5YOhN6z1Jk3506DVF+0QzCzY=Gwg5RA@mail.gmail.com
Whole thread Raw
In response to Re: [patch] pg_copy - a command for reliable WAL archiving  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: [patch] pg_copy - a command for reliable WAL archiving
List pgsql-hackers
On Tue, Aug 19, 2014 at 10:42 PM, Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:
> Is there a way to create a link to a file which only exists as an open
> file descriptor?   If there was, you could create a temp file, open an
> fd, then delete the file.  That would remove the issue with files being
> leaked due to failures of various kinds.


Sort of. On recent Linuxen you can create a file with open(O_TMPFILE)
then use linkat(2) to create a link for it only once it's fully
written.

-- 
greg



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: [PATCH] Incremental backup: add backup profile to base backup
Next
From: Greg Stark
Date:
Subject: Re: [patch] pg_copy - a command for reliable WAL archiving