pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jason Mathis <jmathis@redzonesoftware.com>
To: pgsql-admin@postgresql.org
Subject: archiving wal files after PITR
Date: Mon, 24 Mar 2014 15:59:29 -0600
Message-ID: <etPan.5330aac1.507ed7ab.fb4f@palos> (raw)
In-Reply-To: <etPan.5330aa11.46e87ccd.fb4f@palos>
References: <etPan.5330a6f4.625558ec.fb4f@palos>
	<etPan.5330aa11.46e87ccd.fb4f@palos>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

Hi All,

This is a difficult question to frame since I am currently new to postgres and trying to implement a continuous archiving strategy at this new company. 

Postgresql 9.2.7
Centos 6.5 

I am using pg_basebackup to create a backup. I am not backing up the xlog dir. I am using a script for the archiving process which is using this command:

usr/bin/test ! -f $PGARCHIVE_DIR/$2 && /usr/bin/sudo cp $1 $PGARCHIVE_DIR/$2

Pretty straight forward at this point. I also have a restore script that works well. Gets the base backup and restores the needed wal files. The restores completes, is successful and starts a new timeline. All good! But……

One strange problem exists. I now start getting errors about the last restored wal files cannot be archived. Because its already archived which sounds right to me after all the postgres know it got it from the archive. Now in the case of the last restore test I did, I restored two wal files but only the last one cannot be archived (seems to always be the last one). If I look in the pg_xlog/archive_status I will see something like:

-rw------- 1 postgres postgres    0 Mar 24 20:52 00000006000000010000002B.done
-rw------- 1 postgres postgres    0 Mar 24 20:54 00000006000000010000002C.done
-rw------- 1 postgres postgres    0 Mar 24 20:54 00000006000000010000002C.ready
-rw------- 1 postgres postgres    0 Mar 24 20:49 00000006.history.done
-rw------- 1 postgres postgres    0 Mar 24 20:54 00000007.history.read

See it? What the heck. 00000006* was from the restore AND are all marked *.done except 00000006000000010000002C.* which has two entries! one “done” and one “ready.” 

Its perfectly possible I am doing something wrong. I know could manually fix the issue by deleting the .ready file, but I need this to be right and to understand what is happening. Can anyone explain this behavior? 

Thanks!
-- 
 

This transmission contains confidential and privileged information intended 
solely for the party identified above. If you receive this message in 
error, you must not use it or convey it to others. Please destroy it 
immediately and contact the sender at (303) 386-3955 or by return e-mail to 
the sender.

view thread (2+ messages)  latest in thread

Message-ID: <etPan.5330aac1.507ed7ab.fb4f@palos>
Permalink:  ../etPan.5330aac1.507ed7ab.fb4f@palos/
Also on:    postgresql.org/message-id/etPan.5330aac1.507ed7ab.fb4f@palos

 · 

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: jmathis@redzonesoftware.com
  Subject: Re: archiving wal files after PITR
  In-Reply-To: <etPan.5330aac1.507ed7ab.fb4f@palos>

* 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