Streaming replication document

Lists: pgsql-hackers
From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Streaming replication document
Date: 2010-12-04 02:18:20
Message-ID: 20101204.111820.60332142212192675.t-ishii@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

There is a description about streaming replication in the doc:
----------------------------------------------------------
25.2.5. Streaming Replication

:
:
If you set up a WAL archive that's accessible from the
standby, wal_keep_segments is not required as the standby can always
use the archive to catch up.
----------------------------------------------------------

I think this description is somewhat inadequate. Since recovery using
WAL archive is file based, it may cause long replication delay. I
think even if WAL archive is set up, we should set wal_keep_segments
to proper value, not 0. Recovery from WAL archive should be the last
resort, shouldn't be?
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp


From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Tatsuo Ishii <ishii(at)postgresql(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Streaming replication document
Date: 2010-12-04 07:53:49
Message-ID: 4CF9F38D.9020104@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 04.12.2010 04:18, Tatsuo Ishii wrote:
> There is a description about streaming replication in the doc:
> ----------------------------------------------------------
> 25.2.5. Streaming Replication
>
> :
> :
> If you set up a WAL archive that's accessible from the
> standby, wal_keep_segments is not required as the standby can always
> use the archive to catch up.
> ----------------------------------------------------------
>
> I think this description is somewhat inadequate. Since recovery using
> WAL archive is file based, it may cause long replication delay. I
> think even if WAL archive is set up, we should set wal_keep_segments
> to proper value, not 0. Recovery from WAL archive should be the last
> resort, shouldn't be?

If your standby falls behind that much, catching up is going to take a
while anyway. The master always keeps 2-3 * checkpoint_segments WAL
segments around anyway even if wal_keep_segments is 0.

Depending on the archive, it might well be faster to catch up using the
archive, instead of streaming from master.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com