pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ibrahim Harrani <ibrahim.harrani@gmail.com>
To: pgsql-admin@postgresql.org
Subject: pg_standby and continuous recovery
Date: Thu, 16 Oct 2008 11:18:21 +0300
Message-ID: <530068a0810160118m70eb10d9q8b3c895aa1907fc2@mail.gmail.com> (raw)

Hello,

I am using pg_standby with PostgreSQL 8.2.4.
I configured master and standby server according to the articles at
http://michsan.blogspot.com/2008/08/using-pgstandby-for-high-availability.html
and http://www.postgresql.org/docs/8.3/static/pgstandby.html.

my recovery.conf file is like following:
# more recovery.conf
restore_command = 'pg_standby -l -d -s 2 -k 40 -t
/tmp/pgsql.trigger.5442 /pgarsiv %f %p %r 2>>standby.log'
[root@mysql-ndb2 data]#


I can successfully recover and start the standby server. I can see
that the database is completely restored. (recovery.conf was renamed
as recovery.done)
But I would like to continue recovering from last recovery point
restored by pg_standby without starting from scratch.
Can I do this? If the answer is positve, which procedure should I apply?
After recovering standby server. I have the following files in the
pg_xlog directory.
# ls -l
total 16412
-rw------- 1 postgres postgres 16777216 Oct 16 12:51 0000000200000000000000CA
lrwxrwxrwx 1 postgres postgres       33 Oct 16 12:30
0000000200000000000000CB -> /pgarsiv/0000000100000000000000C9
-rw------- 1 postgres postgres       75 Oct 16 12:30 00000002.history
drwx------ 2 postgres postgres     4096 Oct 16 12:30 archive_status
lrwxrwxrwx 1 postgres postgres       25 Oct 16 12:54 RECOVERYHISTORY
-> /pgarsiv/00000002.history

As you can see below, all archive file names are staring with "00000001"

# ls -l /pgarsiv/
total 262468
-rw------- 1 postgres postgres 16777216 Oct 16 12:03 0000000100000000000000C3
-rw------- 1 postgres postgres      241 Oct 16 12:03
0000000100000000000000C3.00000070.backup
-rw------- 1 postgres postgres 16777216 Oct 16 12:09 0000000100000000000000C4
-rw------- 1 postgres postgres 16777216 Oct 16 12:13 0000000100000000000000C5
-rw------- 1 postgres postgres 16777216 Oct 16 12:19 0000000100000000000000C6
-rw------- 1 postgres postgres 16777216 Oct 16 12:21 0000000100000000000000C7
-rw------- 1 postgres postgres 16777216 Oct 16 12:23 0000000100000000000000C8
-rw------- 1 postgres postgres 16777216 Oct 16 12:25 0000000100000000000000C9
-rw------- 1 postgres postgres 16777216 Oct 16 12:29 0000000100000000000000CA
-rw------- 1 postgres postgres 16777216 Oct 16 12:33 0000000100000000000000CB
-rw------- 1 postgres postgres 16777216 Oct 16 12:39 0000000100000000000000CC
-rw------- 1 postgres postgres 16777216 Oct 16 12:43 0000000100000000000000CD
-rw------- 1 postgres postgres 16777216 Oct 16 12:47 0000000100000000000000CE
-rw------- 1 postgres postgres 16777216 Oct 16 12:49 0000000100000000000000CF
-rw------- 1 postgres postgres 16777216 Oct 16 12:53 0000000100000000000000D0
-rw------- 1 postgres postgres 16777216 Oct 16 12:59 0000000100000000000000D1
-rw------- 1 postgres postgres 16777216 Oct 16 13:03 0000000100000000000000D2

But pg_standby is looking for the files name starting with 00000002!

Trigger file            : /tmp/pgsql.trigger.5442
Waiting for WAL file    : 00000002.history
WAL file path           : /pgarsiv/00000002.history
Restoring to...         : pg_xlog/RECOVERYHISTORY
Sleep interval          : 2 seconds
Max wait interval       : 0 forever
Command for restore     : ln -s -f "/pgarsiv/00000002.history"
"pg_xlog/RECOVERYHISTORY"
Keep archive history    : %r and later
running restore         : OK
Trigger file            : /tmp/pgsql.trigger.5442
Waiting for WAL file    : 0000000200000000000000CA
WAL file path           : /pgarsiv/0000000200000000000000CA
Restoring to...         : pg_xlog/RECOVERYXLOG
Sleep interval          : 2 seconds
Max wait interval       : 0 forever
Command for restore     : ln -s -f "/pgarsiv/0000000200000000000000CA"
"pg_xlog/RECOVERYXLOG"
Keep archive history    : %r and later

Any help is appreciated



view thread (2+ messages)  latest in thread

Message-ID: <530068a0810160118m70eb10d9q8b3c895aa1907fc2@mail.gmail.com>
Permalink:  ../530068a0810160118m70eb10d9q8b3c895aa1907fc2@mail.gmail.com/
Also on:    postgresql.org/message-id/530068a0810160118m70eb10d9q8b3c895aa1907fc2@mail.gmail.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-admin@postgresql.org
  Cc: ibrahim.harrani@gmail.com
  Subject: Re: pg_standby and continuous recovery
  In-Reply-To: <530068a0810160118m70eb10d9q8b3c895aa1907fc2@mail.gmail.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