Re: Streaming rep - why log shipping is necessary? - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: Streaming rep - why log shipping is necessary?
Date
Msg-id 3f0b79eb1003030515r5ecc5d13y4f06f6b6389e8bcf@mail.gmail.com
Whole thread Raw
In response to Re: Streaming rep - why log shipping is necessary?  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers
On Fri, Feb 26, 2010 at 2:34 AM, Josh Berkus <josh@agliodbs.com> wrote:
>
>>> If you're adventurous enough, it's actually possible to set an
>>> archive_command that checks the status of the standby and returns
>>> failure as long as the standby still needs the given WAL segment. That
>>> way the primary doesn't recycle segments that are still needed by the
>>> standby, and you can get away without restore_command in the standby.
>
> I'd prefer something a little different ... is there any way to tell
> which log segments a standby still needs, *from* the standby?

pg_controldata can tell that. The log segment containing the "Latest
checkpoint's REDO location" that pg_controldata reports is the oldest
one still required for the standby. So we can remove the older log
segments than it from the archive.

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: recovery.conf.sample
Next
From: Robert Haas
Date:
Subject: Re: renameatt() can rename attribute of index, sequence, ...