Re: wal shipping/pg_standby docs patch

Lists: pgsql-docs
From: Frank Wiles <frank(at)revsys(dot)com>
To: pgsql-docs(at)postgresql(dot)org
Subject: wal shipping/pg_standby docs patch
Date: 2009-03-25 19:20:51
Message-ID: 7bbd319d0903251220n1c009a7i95b559387812bd85@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-docs

Hello,

It has been awhile since I setup a warm standby server, so I dutifully
followed the documentation. However, the documentation specifically
suggests using 'cp -i' as the archive command. Granted, it does say
that it is only a suggestion and not a recommendation, but does
specifically mention it for Linux.

Wasn't three days before I was bitten by transferring a WAL file
before it was fully copied into the archive location.

Attached is a patch that makes the suggestion be 'rsync -avr' in both
backup.sgml and pg_standby.sgml.

Thanks!

--
Frank Wiles
Revolution Systems | http://www.revsys.com/
frank(at)revsys(dot)com | (800) 647-6298

Attachment Content-Type Size
rsync-doc.patch text/x-diff 1.4 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Frank Wiles <frank(at)revsys(dot)com>
Cc: pgsql-docs(at)postgresql(dot)org
Subject: Re: wal shipping/pg_standby docs patch
Date: 2009-03-26 02:04:11
Message-ID: 11504.1238033051@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-docs

Frank Wiles <frank(at)revsys(dot)com> writes:
> Attached is a patch that makes the suggestion be 'rsync -avr' in both
> backup.sgml and pg_standby.sgml.

Seems to me the first question to ask is exactly why you got "bit" by
cp. I doubt that rsync will provide a magic answer.

regards, tom lane


From: Frank Wiles <frank(at)revsys(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-docs(at)postgresql(dot)org
Subject: Re: wal shipping/pg_standby docs patch
Date: 2009-03-26 16:08:50
Message-ID: 7bbd319d0903260908k432c5c0ej7490a9e6224a1cda@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-docs

On Wed, Mar 25, 2009 at 9:04 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Frank Wiles <frank(at)revsys(dot)com> writes:
>> Attached is a patch that makes the suggestion be 'rsync -avr' in both
>> backup.sgml and pg_standby.sgml.
>
> Seems to me the first question to ask is exactly why you got "bit" by
> cp.  I doubt that rsync will provide a magic answer.
>
>                        regards, tom lane

Hi Tom,

Using the example in the docs in both places suggests using cp to copy
to your archive location, which isn't atomic. This leaves open the
possibility of transferring to your warm standby server part of a WAL
file. In my case I was using rsync in cron to pull from the "master"
onto the warm standby server. Ran fine for 3 days, then I transferred
a 14MB and a 8.2MB WAL file. Basically being unlucky and transferring
it at just the wrong time.

This obviously hosed the warm standby and I had to go through the
whole backup procedure again. Using rsync, as it is atomic, prevents
this.

--
Frank Wiles
Revolution Systems | http://www.revsys.com/
frank(at)revsys(dot)com | (800) 647-6298