problem with archive_command as suggested by documentation - Mailing list pgsql-hackers

From Albe Laurenz
Subject problem with archive_command as suggested by documentation
Date
Msg-id D960CB61B694CF459DCFB4B0128514C202FCC972@exadv11.host.magwien.gv.at
Whole thread Raw
Responses Re: problem with archive_command as suggested by documentation  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Re: problem with archive_command as suggested by documentation  (decibel <decibel@decibel.org>)
List pgsql-hackers
The documentation states in
http://www.postgresql.org/docs/current/static/continuous-archiving.html#BACKUP-ARCHIVING-WAL

"The archive command should generally be designed to refuse to overwrite any pre-existing archive file."

and suggests an archive_command like "test ! -f .../%f && cp %p .../%f".

We ran into (small) problems with an archive_command similar to this
as follows:

The server received a fast shutdown request while a WAL segment was being archived.
The archiver stopped and left behind a half-written archive file.

Now when the server was restarted, the archiver tried to archive the same
WAL segment again and got an error because the destination file already
existed.

That means that WAL archiving is stuck until somebody manually removes
the partial archived file.


I suggest that the documentation be changed so that it does not
recommend this setup. WAL segment names are unique anyway.

What is your opinion? Is the problem I encountered a corner case
that should be ignored?

Yours,
Laurenz Albe

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Pluggable Indexes (was Re: rmgr hooks (v2))
Next
From: Robert Haas
Date:
Subject: Re: Pluggable Indexes