pg_standby and continuous recovery

From: "Ibrahim Harrani" <ibrahim(dot)harrani(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: pg_standby and continuous recovery
Date: 2008-10-16 08:18:21
Message-ID: 530068a0810160118m70eb10d9q8b3c895aa1907fc2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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(at)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

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Carol Walter 2008-10-16 13:47:48 Re: Upgrade in same major version
Previous Message Martin Badie 2008-10-16 08:10:27 Re: replication with table add/removes..