pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Shaun Thomas <sthomas@peak6.com>
To: Waldomiro <waldomiro@shx.com.br>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: Why I lost the last pg_xlog file?
Date: Thu, 27 Jan 2011 08:17:23 -0600
Message-ID: <4D417E73.7040901@peak6.com> (raw)
In-Reply-To: <4D416099.8060107@shx.com.br>
References: <4D416099.8060107@shx.com.br>

On 01/27/2011 06:10 AM, Waldomiro wrote:

> 3) I check the pg_xlog, there was created 6 logs, but in the archive
> there was only 5.

xlogs are only "archived" when they'd normally be deleted. If you have 
really high data turnover or very frequent checkpoints, that effectively 
happens constantly. I'm not sure where the cutoff is, but there's a 
certain amount of "reserve" xlog space based on your checkpoint_segments 
setting.

It is an archive, after all. pg_start_backup/pg_stop_backup ensure your 
backup is consistent, nothing else. Depending on your archives to 
capture everything isn't going to work. If you really want everything, 
you can either copy the xlogs manually (not safe) or initiate another 
backup. You can kinda fudge it doing this:

1. Call pg_current_xlog_location to get the current xlog.
2. Call pg_switch_xlog to force a new xlog.
3. Copy the file from step 1 and anything older than it to your 
archive/slave. Doing this *may* confuse the built-in archive system if 
your archive_command is too strict.
4. Profit.

-- 
Shaun Thomas
OptionsHouse | 141 W. Jackson Blvd. | Suite 800 | Chicago IL, 60604
312-676-8870
sthomas@peak6.com

______________________________________________

See  http://www.peak6.com/email_disclaimer.php
for terms and conditions related to this email



view thread (3+ messages)  latest in thread

Message-ID: <4D417E73.7040901@peak6.com>
Permalink:  ../4D417E73.7040901@peak6.com/
Also on:    postgresql.org/message-id/4D417E73.7040901@peak6.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: sthomas@peak6.com, waldomiro@shx.com.br
  Subject: Re: Why I lost the last pg_xlog file?
  In-Reply-To: <4D417E73.7040901@peak6.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox