AW: Idea: recycle WAL segments, don't delete/recreate ' em

Started by Zeugswetter Andreas SBover 24 years ago2 messages
#1Zeugswetter Andreas SB
ZeugswetterA@wien.spardat.at

I just had an idea about how to avoid this cost:
why not recycle old log segments? At the point where the code
currently deletes a no-longer-needed segment, just rename it to
become the next created-in-advance segment.

Yes, since I already suggested this on Feb 26. I naturally think this
is a good idea, iirc Vadim also stated similar ideas.

http://fts.postgresql.org/db/mw/msg.html?mid=73076

Maybe I did not make myself clear enough though, you clearly did better :-)

Another issue is whether the recycling logic should be "always recycle"
(hence number of extant WAL segments will never decrease), or should
it be more like "recycle if there are fewer than WAL_FILES advance
segments, else delete".

Yes, I think we should use the WAL_FILES parameter to state how many WAL files
should be kept around, or better yet only use it if it is not 0.
Thus the default would be to never decrease, but if the admin went to the
trouble of specifying a (good) value, that should imho be honored.

Andreas

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Zeugswetter Andreas SB (#1)
Re: AW: Idea: recycle WAL segments, don't delete/recreate ' em

Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at> writes:

Yes, since I already suggested this on Feb 26.

So you did. Darn, I thought it was original ;-)

regards, tom lane