Re: WAL rotation question version 8.3.0

From: Evan Rempel <erempel(at)uvic(dot)ca>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: WAL rotation question version 8.3.0
Date: 2008-05-15 21:49:28
Message-ID: 482CAFE8.2020102@uvic.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

>>>> Now to the question.
>>>>
>>>> Once the archive_command starts lying about its success, postgresql deletes
>>>> a number of the xlog files that it has been told have been successfuly archived.
>>>> Why does it do this? Can I control it? Can I turn it off?
>>> Because they're no longer needed.
>>>
>>> If you want to keep those files, make the archive_command not lie.
>>
>> Normally posgres will rename the old WAL files that have been archived and are no longer needed,
>> keeping the number of WAL files constant. In this case, it actually deletes them.
>> Why is the behaviour different?
>
> Renaming files is done because the files will be reused in the future
> under the new name. However, after a long archiver failure, new files
> need to be created to hold the extra data. When the archiver is
> restored, those excess files can be deleted because they're not needed
> for recycling. (The number of files to keep for recycling is a function
> of checkpoint_segments.)

So it looks like postgresql will try to keep 2.5 * checkpoint_segments files,
and if it has more that have been reported as archived, then it will
start removing them.

Does this sound correct?

--
Evan Rempel

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message shohorab hossain 2008-05-16 01:49:21 Re: [DOCS] problem in installing pgsql-8.3.1
Previous Message Alvaro Herrera 2008-05-15 21:31:28 Re: WAL rotation question version 8.3.0