Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id EB2E92E002F for ; Thu, 15 May 2008 18:31:36 -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 60611-04 for ; Thu, 15 May 2008 18:31:30 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by developer.postgresql.org (Postfix) with ESMTP id C44112E002D for ; Thu, 15 May 2008 18:31:33 -0300 (ADT) Received: from perhan.alvh.no-ip.org (200-126-123-196.bk8-dsl.surnet.cl [200.126.123.196]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id m4FLWXaK018518 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 15 May 2008 14:32:35 -0700 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 0BD4147C5E; Thu, 15 May 2008 17:31:28 -0400 (CLT) Date: Thu, 15 May 2008 17:31:28 -0400 From: Alvaro Herrera To: Evan Rempel Cc: pgsql-admin@postgresql.org Subject: Re: WAL rotation question version 8.3.0 Message-ID: <20080515213127.GP8221@alvh.no-ip.org> References: <482CA173.7020204@uvic.ca> <20080515211353.GO8221@alvh.no-ip.org> <482CA841.8000605@uvic.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <482CA841.8000605@uvic.ca> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Thu, 15 May 2008 14:32:35 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/142 X-Sequence-Number: 29226 Evan Rempel wrote: > Alvaro Herrera wrote: >> Evan Rempel wrote: >> >>> 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? >> >> Because they're no longer needed. >> >> If you want to keep those files, make the archive_command not lie. > > > Normally posgres will rename the old WAL files that have been archived and are no longer needed, > keeping the number of WAL files constant. In this case, it actually deletes them. > Why is the behaviour different? Renaming files is done because the files will be reused in the future under the new name. However, after a long archiver failure, new files need to be created to hold the extra data. When the archiver is restored, those excess files can be deleted because they're not needed for recycling. (The number of files to keep for recycling is a function of checkpoint_segments.) -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.