Re: Idea: recycle WAL segments, don't delete/recreate 'em - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Idea: recycle WAL segments, don't delete/recreate 'em
Date
Msg-id 4966.995469543@sss.pgh.pa.us
Whole thread Raw
In response to Re: Idea: recycle WAL segments, don't delete/recreate 'em  (Patrick Macdonald <patrickm@redhat.com>)
Responses Re: Idea: recycle WAL segments, don't delete/recreate 'em  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Patrick Macdonald <patrickm@redhat.com> writes:
> Yes, but in a very roundabout way (or so it seems).  The main point
> that I was trying to illustrate was that if a database supports 
> point-in-time recovery, recycling of the only available log segments 
> is a bad thing.

Certainly, but deleting them is just as bad ;-).

What would need to be changed to use the WAL log for archival purposes
is the control logic that decides when an old log segment is no longer
needed.  Rather than zapping them as soon as they're not needed for
crash recovery (our current approach), they'd have to stick around until
archived offline, or perhaps for some DBA-specified length of time
representing how far back you want to allow for PIT recovery.

Nonetheless, at some point an old WAL segment will become deletable
(unless you have infinite space on your WAL disk).  ISTM that at that
point, it makes sense to consider recycling the file rather than
deleting it.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Mitch Vincent"
Date:
Subject: Re: PQexec() 8191 bytes limit and text fields
Next
From: Tom Lane
Date:
Subject: Re: AW: Idea: recycle WAL segments, don't delete/recreate ' em