pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ray Stell <stellr@cns.vt.edu>
To: Yauheni Labko <yyl@chappy.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: standby waiting for what?
Date: Thu, 5 Mar 2009 08:55:56 -0500
Message-ID: <20090305135556.GA9900@cns.vt.edu> (raw)
In-Reply-To: <200903041705.19794.yyl@chappy.com>
References: <20090304200612.GA25611@cns.vt.edu>
	<200903041541.06149.yyl@chappy.com>
	<20090304213500.GE25611@cns.vt.edu>
	<200903041705.19794.yyl@chappy.com>

On Wed, Mar 04, 2009 at 05:05:19PM -0500, Yauheni Labko wrote:
> No. %f is the WAL filename which is needed by the server to start recovery.  

my recovery command is:
restore_command='/usr/local/pgsql/bin/pg_standby  /data/pgsql/wals/alerts_oamp %f %p %r >> /home/postgresql/log/alerts_oamp/recovery.log'

the process that is running is, from the ps command:

sh -c /usr/local/pgsql/bin/pg_standby  /data/pgsql/wals/alerts_oamp
+00000002000000000000001C.00512178.backup pg_xlog/RECOVERYHISTORY 000000000000000000000000 >>
+/home/postgresql/log/alerts_oamp/recovery.log

there are 4 args to pg_standby:

1. /data/pgsql/wals/alerts_oamp the archive dir
2. 00000002000000000000001C.00512178.backup = %f
3. pg_xlog/RECOVERYHISTORY = %p
4. 000000000000000000000000 = %r

Looks like %f to me.  Right?  So, how could it get set to a funky value like that?


> 00000002000000000000001C.00512178.backup will give you start and end of WAL 
> segment, the WAL filename containing this segment and your label to identify 
> where it might be. That's why I asked you about your backup.


I don't follow you here.  How did you know that the string, 
00000002000000000000001C.00512178.backup will provide the start and
end of WAL segment?  Please explain how you determined this?

I suspect the standy is waiting for a WAL named 00000002000000000000001C 
and that file exists on the standby:

ls -l /data/pgsql/wals/alerts_oamp/
total 114828
-rw------- 1 postgresql postgresql 16777216 Mar  4 11:28 00000002000000000000001A
-rw------- 1 postgresql postgresql 16777216 Mar  4 11:29 00000002000000000000001B
-rw------- 1 postgresql postgresql 16777216 Mar  4 12:24 00000002000000000000001C
-rw------- 1 postgresql postgresql 16777216 Mar  4 12:25 00000002000000000000001D
-rw------- 1 postgresql postgresql 16777216 Mar  4 12:26 00000002000000000000001E
-rw------- 1 postgresql postgresql 16777216 Mar  4 14:45 00000002000000000000001F
-rw------- 1 postgresql postgresql 16777216 Mar  4 14:45 000000020000000000000020

but, somehow I confused pg and the name being passed to pg_standby is wrong.

I have a suspicion that if I mv /data/pgsql/wals/alerts_oamp/00000002000000000000001C
to /data/pgsql/wals/alerts_oamp/00000002000000000000001C.00512178.backup that the 
recovery would pick up.  If there is no understanding to be gained here, I might do
that and then throw this out with the bath water and start over.

> What is the archive_command for primary server?

the archive command is working fine as you see above.  It just runs a local 
script that does an rsync of the pg_xlog wal file over to the standby.

I agree with you, something about the backup must have caused this
confusion.  I'm just rsyncing the cluster dir from the primary to the
standby, removing pg_xlogs files, and setting recovery.conf.  Is there 
a better way?



view thread (14+ messages)  latest in thread

Message-ID: <20090305135556.GA9900@cns.vt.edu>
Permalink:  ../20090305135556.GA9900@cns.vt.edu/
Also on:    postgresql.org/message-id/20090305135556.GA9900@cns.vt.edu

 · 

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: stellr@cns.vt.edu, yyl@chappy.com
  Subject: Re: standby waiting for what?
  In-Reply-To: <20090305135556.GA9900@cns.vt.edu>

* 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