pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Evan Rempel <erempel@uvic.ca>
To: pgsql-admin@postgresql.org
Subject: Re: WAL rotation question version 8.3.0
Date: Thu, 15 May 2008 14:49:28 -0700
Message-ID: <482CAFE8.2020102@uvic.ca> (raw)
In-Reply-To: <20080515213127.GP8221@alvh.no-ip.org>
References: <482CA173.7020204@uvic.ca>
	<20080515211353.GO8221@alvh.no-ip.org>
	<482CA841.8000605@uvic.ca>
	<20080515213127.GP8221@alvh.no-ip.org>

>>>> 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



view thread (5+ messages)

Message-ID: <482CAFE8.2020102@uvic.ca>
Permalink:  ../482CAFE8.2020102@uvic.ca/
Also on:    postgresql.org/message-id/482CAFE8.2020102@uvic.ca

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: erempel@uvic.ca
  Subject: Re: WAL rotation question version 8.3.0
  In-Reply-To: <482CAFE8.2020102@uvic.ca>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox