Re: Continuous archiving fails routinely with "invalid magic number" error

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Bruce Reed" <breed(at)dvdplay(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Continuous archiving fails routinely with "invalid magic number" error
Date: 2009-05-29 14:21:26
Message-ID: 16782.1243606886@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"Bruce Reed" <breed(at)dvdplay(dot)com> writes:
> I am having problems getting continuous archiving to work reliably on my
> Postgres 8.3 system. My primary is running 8.3.1, has archiving turned on
> and writes logs to a NFS mount that lives on the backup server. The warm
> standby is running 8.3.3. Initially things work fine with the primary
> copying logs to the archive directory correctly and the warm standby in
> recovery mode plays them back okay. At some point the following appears in
> the syslog:

I'm wondering whether you are doing anything to ensure that the copy
operation appears atomic to the standby? This behavior looks about like
what I'd expect if the standby tried to read a WAL file before it'd been
completely copied. You might try copying files to some temporary name
that doesn't look like a WAL file name, and then renaming them into
place when the copy is complete.

BTW, I see another issue here:

> May 26 08:59:26 ods2-prod postgres[3827]: [1432-1] LOG: could not create
> archive status file "pg_xlog/archive_status/00000002.history.ready": No such
> file or directory

Does the archive_status/ subdirectory exist? If not, create it by hand,
making sure it has the same ownership and permissions as pg_xlog/.
It's fairly easy to forget to recreate this directory when you are
setting up a backup system. CVS HEAD has some code to recreate it
automatically if it's not there, but that's not in 8.3.

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message David F. Skoll 2009-05-29 14:33:45 Efficiently searching for CIDRs containing an IP address
Previous Message Bruce Reed 2009-05-29 03:43:55 Re: Continuous archiving fails routinely with "invalid magic number" error