PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID15335
PG Version9.6.10
OSDebian Stretch
Opened2018-08-16 16:10:00+00
Reported byPhil Endecott
StatusOpen

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      15335
Logged by:          Phil Endecott
Email address:      (redacted)
PostgreSQL version: 9.6.10
Operating system:   Debian Stretch
Description:        

The docs in section 25.3.1 say that archive_command should check if the
target file already exists and fail in that case.  It seems that this is not
entirely true; the command should succeed if the target file already exists
and its content is the same as the source.
This is explicitly mentioned in section 26.2.9 for the case of cascaded
replication with a shared archive, but I understand that this is actually
needed in all cases.  I encountered this during a failed attempt at
promotion, but there are likely to be other cases.  Quoting David Steele
from the -general mailing list:

"Duplicate WAL is possible in *all* cases. A trivial example is that
Postgres calls archive_command and it succeeds but an error happens (e.g.
network) right before Postgres is notified. It will wait a bit and try the
same WAL segment again."

Note that the example archive commands in the documentation (using cp) get
this wrong.  Minimal examples of archive commands that do this check
correctly would be very useful.

(I worry that the non-WAL files that archive_command and restore_command are
also invoked for, e.g. the .backup and .history files, have some additional
or possibly even conflicting requirements.)

Messages

DateAuthorSubject
2018-08-16 16:10:00+00=?utf-8?q?PG_Bug_reporting_form?=BUG #15335: Documentation is wrong about archive_command and existing files
2018-08-16 17:01:24+00Stephen FrostRe: BUG #15335: Documentation is wrong about archive_command and existing files
2018-08-18 14:23:34+00Jeff JanesRe: BUG #15335: Documentation is wrong about archive_command and existing files
2018-08-18 16:51:44+00"Phil Endecott"Re: BUG #15335: Documentation is wrong about archive_command and existing files
2018-08-19 00:09:06+00Jeff JanesRe: BUG #15335: Documentation is wrong about archive_command and existing files
2018-08-19 00:49:39+00Michael PaquierRe: BUG #15335: Documentation is wrong about archive_command and existing files
2018-08-19 21:42:12+00David SteeleRe: BUG #15335: Documentation is wrong about archive_command and existing files
2018-08-20 13:24:48+00Stephen FrostRe: BUG #15335: Documentation is wrong about archive_command and existing files
2018-08-22 12:35:33+00David SteeleRe: BUG #15335: Documentation is wrong about archive_command and existing files