Michael Tharp wrote:
> On 04/30/2010 01:53 PM, Robert Haas wrote:
>>
>> Well, one of us is. Why would you want to retain all of your WAL logs
>> in pg_xlog forever?
>
> To create or re-synchronize SR slaves, one could change
> wal_keep_segments to -1, run a backup, wait for the slaves to catch up,
> and change it back to the default. This way no segments would be deleted
> until the system has reached a stable state.
A slave can fall behind at any time, though. You would have to know to
set wal_keep_segments to -1 before that happens.
I've been thinking that in the future (read 9.1 or above), we would have
a system for registering slaves in the primary server. The primary would
keep track of how far each slave is, and refrain from removing WAL
segments that it knows to be still needed by a slave. On the flip-side,
the master wouldn't need to keep WAL around that it knows is no longer
needed by any slaves.
If someone has the energy, it would be possible to write a stand-alone
application to do that too. It could serve old WAL files from the
archive and rely recent ones from the real master.
-- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com