Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 49088633B5F for ; Mon, 19 Apr 2010 14:12:06 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 47531-05-6 for ; Mon, 19 Apr 2010 17:11:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by mail.postgresql.org (Postfix) with ESMTP id B1968633B3C for ; Mon, 19 Apr 2010 14:10:44 -0300 (ADT) Received: by fg-out-1718.google.com with SMTP id d23so2047708fga.1 for ; Mon, 19 Apr 2010 10:10:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type; bh=4FpqgwsobMRgD80Q7leuVDNsfZN6u0HuBBH9jXK8Q9s=; b=bQ/EeK/UJ7sSzF68Ei5PMm4O5bqcvKFbxWUU1NJVt7DQrlfX50Uw0zZQ8zyXhpBHWy tCpgEQV82RLRgWjMKq4Eem53E9lf2wxz2aoztACDzkT1KxqR/aPPxh7LGv2vf19pKf28 yXeLtjqRqAkkbYOUHjWqBc5MRSXdWFPqEggDw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; b=D4v3cvuTx0QOuj+7XsDUuuH93gCYiVGwQs3YoPpZ6/hV33Y6ZWTdRtKOyIKCkacmBg D5zDVPK24M+1ZXBMJyFPtV0Cz0OKg4ktEULG/YqvV87/qAeNiAydjcFhHBZhBr4yMKIy Q4kzaVFI0Z9ol5p55SiZOtcdkTlk53IBJmALw= Received: by 10.223.63.17 with SMTP id z17mr163175fah.66.1271697018918; Mon, 19 Apr 2010 10:10:18 -0700 (PDT) Received: from [192.168.1.253] (adsl-71-140-54-198.dsl.pltn13.pacbell.net [71.140.54.198]) by mx.google.com with ESMTPS id y37sm368657mug.52.2010.04.19.10.10.16 (version=SSLv3 cipher=RC4-MD5); Mon, 19 Apr 2010 10:10:17 -0700 (PDT) Message-ID: <4BCC8E76.2040105@gmail.com> Date: Mon, 19 Apr 2010 10:10:14 -0700 From: Frederiko Costa User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc11 Thunderbird/3.0.4 MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Re: archived WALL files question References: <7965A9DCF12CC14984420BCC37B1608F25AC0B99AD@Elzar.grant.co.uk> <4BC6F21D0200002500030956@gw.wicourts.gov> <7965A9DCF12CC14984420BCC37B1608F25AC0B99E4@Elzar.grant.co.uk> <4BCC7804.9070604@gmail.com> <4BCC415D0200002500030A6B@gw.wicourts.gov> In-Reply-To: <4BCC415D0200002500030A6B@gw.wicourts.gov> Content-Type: multipart/alternative; boundary="------------000107020109030001020300" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201004/260 X-Sequence-Number: 34354 This is a multi-part message in MIME format. --------------000107020109030001020300 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I have seen new 16 MB segments files created in pg_xlog directory as time goes on. Honestly, I did not understand why it got created, because I was running it on a VM and there was no activity. I got several new segments. If I run the command you asked, this is the output. Neither segment is copied, nor a new segment file gets created: select pg_switch_xlog(); pg_switch_xlog ---------------- 0/81000088 (1 row) Wasn't this command supposed to create a new segment file and copy the last non-copied segments - using command specified at archive_command - to the destination you defined? I wanted to understand why the newly created wal segment files (with 16 MB each) did not copied automatically to the new place. What's the criteria? They only get copied when I carry out a base backup. Thanks for the help! On 04/19/2010 09:41 AM, Kevin Grittner wrote: > Frederiko Costa wrote: > > >> I noticed the new logs files don't get copied to the directory >> specified on the archive_command. It's only copied when I do the >> pg_start_backup()/pg_stop_backup() base backup. Is this behaviour >> only achieved if I set archive_timeout? I did not want to do that, >> because I thought as soon as the 16MB WAL segment file got created >> it would be copied to the exported directory. >> > > Have you actually been filling up any 16MB WAL file segments? How > have you determined that? What happens when you run (as a database > superuser) this command?: > > SELECT pg_switch_xlog(); > > If the reason you don't want to set archive_timeout is that you > don't want 16MB files piling up when there is little or no activity, > you might want to consider using pglesslog or pg_clearxlogtail. > These can eliminate nearly all the cost of the more frequent logs. > > -Kevin > --------------000107020109030001020300 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I have seen new 16 MB segments files created in pg_xlog directory as time goes on. Honestly, I did not understand why it got created, because I was running it on a VM and there was no activity. I got several new segments.

If I run the command you asked, this is the output. Neither segment is copied, nor a new segment file gets created:

 select pg_switch_xlog();
 pg_switch_xlog
----------------
 0/81000088
(1 row)

Wasn't this command supposed to create a new segment file and copy the last non-copied segments - using command specified at archive_command - to the destination you defined?

I wanted to understand why the newly created wal segment files (with 16 MB each) did not copied automatically to the new place. What's the criteria? They only get copied when I carry out a base backup.

Thanks for the help!

On 04/19/2010 09:41 AM, Kevin Grittner wrote:
Frederiko Costa <frederiko@gmail.com> wrote:
 
  
I noticed the new logs files don't get copied to the directory
specified on the archive_command. It's only copied when I do the
pg_start_backup()/pg_stop_backup() base backup. Is this behaviour
only achieved if I set archive_timeout? I did not want to do that,
because I thought as soon as the 16MB WAL segment file got created
it would be copied to the exported directory.
    
 
Have you actually been filling up any 16MB WAL file segments?  How
have you determined that?  What happens when you run (as a database
superuser) this command?:
 
SELECT pg_switch_xlog();
 
If the reason you don't want to set archive_timeout is that you
don't want 16MB files piling up when there is little or no activity,
you might want to consider using pglesslog or pg_clearxlogtail. 
These can eliminate nearly all the cost of the more frequent logs.
 
-Kevin
  
--------------000107020109030001020300--