problem with archive_command as suggested by documentation

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: problem with archive_command as suggested by documentation
Date: 2009-01-22 16:18:12
Message-ID: D960CB61B694CF459DCFB4B0128514C202FCC972@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-01-22 16:20:23 Re: Pluggable Indexes
Previous Message Robert Haas 2009-01-22 16:17:50 Re: Pluggable Indexes (was Re: rmgr hooks (v2))