Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 82C032E0059 for ; Thu, 15 May 2008 17:54:41 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 47381-06 for ; Thu, 15 May 2008 17:54:35 -0300 (ADT) X-Greylist: delayed 00:06:47.341498 by SQLgrey-1.7.6 Received: from dog.comp.uvic.ca (dog.comp.uvic.ca [142.104.5.222]) by developer.postgresql.org (Postfix) with ESMTP id 4FBBF2E0056 for ; Thu, 15 May 2008 17:54:38 -0300 (ADT) Received: from [142.104.191.242] (strike.comp.uvic.ca [142.104.191.242]) by dog.comp.uvic.ca (8.13.8/8.13.8) with ESMTP id m4FKlmDA020022 for ; Thu, 15 May 2008 13:47:48 -0700 Message-ID: <482CA173.7020204@uvic.ca> Date: Thu, 15 May 2008 13:47:47 -0700 From: Evan Rempel User-Agent: Thunderbird 1.5.0.12 (X11/20070530) MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: WAL rotation question version 8.3.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-UVic-Virus-Scanned: OK - Passed virus scan by Sophos (sophie) on dog X-UVic-Spam-Scan: dog.comp.uvic.ca Not_scanned_LOCAL X-Scanned-By: MIMEDefang 2.63 on 142.104.5.91 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200805/139 X-Sequence-Number: 29223 I am setting up a postgresql server (duh) and am using archive_mode=on The archive command that I am using sends data to an enterprise backup server across the network, and I must be able to handle outages of that server without taking down the postgresql server. Short outages are fine because the archive_command will return a non zero result to postgresql and it will be retried every minute until successful. If the backup server is out for a longer time, new WAL files will be created by postgresql. This will eventually fill the pg_xlog filesystem and bad things happen :-( To protect the production database functionality, when the pg_xlog filesystem reaches some percentage full (we chose 90%) then the archive_command starts reporting a success (return of zero) even though it is not able to archive the xlog files. I understand that this prevents me from doing a disaster recovery AND prevents me from doing a point in time restore, but in our opinion it is better than letting the database crash. Now to the question. Once the archive_command starts lying about its success, postgresql deletes a number of the xlog files that it has been told have been successfuly archived. Why does it do this? Can I control it? Can I turn it off? -- Evan Rempel, Senior Systems Administrator University of Victoria