Reasons for not overwriting processed wal archives? - Mailing list pgsql-general

From Koen De Groote
Subject Reasons for not overwriting processed wal archives?
Date
Msg-id CAGbX52EgQ2_3pSTDybkH2HTmn3pXJbEo1Gg6aC2cqqVJ2otJ=Q@mail.gmail.com
Whole thread Raw
Responses Re: Reasons for not overwriting processed wal archives?
List pgsql-general

States:

> It is advisable to test your proposed archive command to ensure that it indeed does not overwrite an existing file, and that it returns nonzero status in this case.

Why exactly is this?

Assuming a situation in which the files, as part of the archive_command, are gzipped to their final location.

If the gzip fails, or stops halfway, perhaps due to a network issue... you're left with a file that isn't the full representation of the wal archive.

So it needs to be done again.

In cases where the file is simply moved, this can also occur. Wal size can be configured, and transfers might fail.

So they'd have to be done again.

If we test first for a file with that name being present, and refusing to go forward if there is... an admin is going to have to manually intervene and delete the half-finished file.

So isn't it better to just overwrite?

What scenario am I missing here?

Regards,
Koen

pgsql-general by date:

Previous
From: Koen De Groote
Date:
Subject: In case of network issues, how long before archive_command does retries
Next
From: "David G. Johnston"
Date:
Subject: Re: Reasons for not overwriting processed wal archives?