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

From Josh Berkus
Subject Re: Streaming rep - why log shipping is necessary?
Date
Msg-id 4B86B4A6.1050200@agliodbs.com
Whole thread Raw
In response to Re: Streaming rep - why log shipping is necessary?  (marcin mank <marcin.mank@gmail.com>)
Responses Re: Streaming rep - why log shipping is necessary?
List pgsql-hackers
>> 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?

Given performance considerations, I'd prefer to set up HS/SR with log
shipping because I don't want any slaves asking the master for a really
old log and interfering with its write performance.  However, that
leaves the issue of "How do I decide when I can delete archived log
segments off the slave because the slave is past them?"

Currently, I'm recommending some interval of time, but that's very brute
force and error-prone.  I'd prefer some elegant way to determine "log
segment contains no unapplied transactions."  Is there one?

--Josh Berkus


pgsql-hackers by date:

Previous
From: Greg Smith
Date:
Subject: Re: pg_stop_backup does not complete
Next
From: Bruce Momjian
Date:
Subject: Re: pg_stop_backup does not complete