pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Kirkwood <markir@coretech.co.nz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: [HACKERS] Point in Time Recovery
Date: Thu, 22 Jul 2004 15:12:21 +1200
Message-ID: <40FF3095.3030001@coretech.co.nz> (raw)
In-Reply-To: <2110.1090463955@sss.pgh.pa.us>
References: <200407132242.i6DMgg612564@candle.pha.pa.us>
	<1089760416.17493.3327.camel@stromboli>
	<40F49AE9.2060805@familyhealth.com.au>
	<1089789682.17493.3890.camel@stromboli>
	<40FF1D88.30404@coretech.co.nz>
	<2110.1090463955@sss.pgh.pa.us>

Well that is interesting :_)


Here is what I am doing on the removal front (I am keeping pg_xlog *now*):

$ cd $PGDATA
$ pg_ctl stop
$ ls|grep -v pg_xlog|xargs rm -rf

The contents of the archive directory just before recovery starts:

$ ls -l $PGDATA/../7.5-archive
total 49212
-rw-------    1 postgres postgres 16777216 Jul 22 14:59 
000000010000000000000000
-rw-------    1 postgres postgres 16777216 Jul 22 14:59 
000000010000000000000001
-rw-------    1 postgres postgres 16777216 Jul 22 14:59 
000000010000000000000002

But here is recovery startup log:

LOG:  database system was shut down at 2004-07-22 14:58:57 NZST
LOG:  starting archive recovery
LOG:  restore_command = "cp /data1/pgdata/7.5-archive/%f %p"
cp: cannot stat `/data1/pgdata/7.5-archive/00000001.history': No such 
file or directory
LOG:  restored log file "000000010000000000000000" from archive
LOG:  checkpoint record is at 0/A4D3E8
LOG:  redo record is at 0/A4D3E8; undo record is at 0/0; shutdown TRUE
LOG:  next transaction ID: 496; next OID: 17229
LOG:  archive recovery complete
LOG:  database system is ready

regards

Mark

Tom Lane wrote:

>
>Huh?  It works fine.
>
>The bit you may be missing is that if you blow away $PGDATA including
>pg_xlog/, you won't be able to recover past whatever you have in your WAL
>archive area.  The archive is certainly not going to include the current
>partially-filled WAL segment, and it might be missing a few earlier
>segments if the archival process isn't speedy.  So you need to keep
>those recent segments in pg_xlog/ if you want to recover to current time
>or near-current time.
>
>
>  
>



view thread (111+ messages)  latest in thread

Message-ID: <40FF3095.3030001@coretech.co.nz>
Permalink:  ../40FF3095.3030001@coretech.co.nz/
Also on:    postgresql.org/message-id/40FF3095.3030001@coretech.co.nz

 · 

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-admin@postgresql.org
  Cc: markir@coretech.co.nz, tgl@sss.pgh.pa.us, simon@2ndquadrant.com
  Subject: Re: [HACKERS] Point in Time Recovery
  In-Reply-To: <40FF3095.3030001@coretech.co.nz>

* 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