Robert Treat <rob(at)xzilla(dot)net>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>, Josh Berkus <josh(at)agliodbs(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
On Thu, Sep 8, 2011 at 2:05 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> That's an option. But I don't think that finding an existing file is so serious
> problem. The most common cases which cause a partially-filled archived
> file are;
>
> 1. The server crashes while WAL file is being archived, and then the server
> restarts. In this case, the restarted server would find partially-filled
> archived file.
>
> 2. In replication environment, the master crashes while WAL file is being
> archived, and then a failover happens. In this case, new master would
> find partially-filled archived file.
>
> In these cases, I don't think it's so unsafe to overwrite an existing file.
Personally, I think both of these show examples of why PG should be
looking hard at either providing a simple robust local directory based
archive_command, or very seriously pointing users at properly written
tools like omniptr, or ptrtools, walmgr, etc...
Neither of those cases should ever happen. If you're copying a file
into the archive, and making it appear non-atomically in your archive,
your doing something wrong.
Period.
No excuses.
a.
--
Aidan Van Dyk Create like a god,
aidan(at)highrise(dot)ca command like a king,
http://www.highrise.ca/ work like a slave.