On Wed, 2007-09-12 at 10:48 -0400, Tom Lane wrote: > Simon Riggs <[EMAIL PROTECTED]> writes: > > The following bug fix has not yet been applied to CVS > > http://archives.postgresql.org/pgsql-patches/2007-06/msg00100.php > > Frankly, this looks much more like it creates a bug than fixes one. > I have not looked at all of the original thread, but this adds a wart > (two warts, really) that seems certain to do the wrong thing in cases > other than the one you are thinking of.
Let me explain the bug and the fix briefly. The current recovery code allows a file to be archived a second time, which will fail if the archive_command is strict and refuses duplicate files. The second failure occurs only in disaster mode, when we have no partially written files from the failing server. The bug is fatal, but there is an easy workaround, if you know it. The manual says this should work and it does not. I have added code that prevents a file from being archived when we know for certain it has already been archived because we just de-archived it during recovery. The fix also closes a loophole in XLogArchiveNotify by stopping the writing of a .ready file if a .done already exists. These actions fix the bug directly, following the main design. -- Simon Riggs 2ndQuadrant http://www.2ndQuadrant.com ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly