Skip site navigation (1) Skip section navigation (2)

Re: archived WALL files question

From: Frederiko Costa <frederiko(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: archived WALL files question
Date: 2010-04-19 17:10:14
Message-ID: 4BCC8E76.2040105@gmail.com (view raw or flat)
Thread:
Lists: pgsql-admin
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(at)gmail(dot)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
>    

In response to

Responses

pgsql-admin by date

Next:From: Kevin GrittnerDate: 2010-04-19 17:26:19
Subject: Re: archived WALL files question
Previous:From: Kevin GrittnerDate: 2010-04-19 16:41:17
Subject: Re: archived WALL files question

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group