Re: Too many .history file in pg_xlog takes lots of space

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: 彭昱傑 <k872892(at)gmail(dot)com>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Too many .history file in pg_xlog takes lots of space
Date: 2018-03-14 07:04:43
Message-ID: 20180314070443.GE16179@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wed, Mar 14, 2018 at 02:12:47PM +0800, 彭昱傑 wrote:
> It's useful information for me.

Once archived, there is no need to keep them in the data folder as if
needed at recovery the startup process would look for timeline history
files where necessary if it needs to do a timeline jump.

> I will examine my restart script, and study point-in-time-recovery.
> Also remove unused history file.

At the same time, the backend makes little effort to remove past
timeline history files, and those are just a couple of bytes, which
accumulate, so after a couple of hundreds of failovers you could bloat
the data folder. Why not making their removal more aggressive at each
restart point created? You don't need any history files older than the
current timeline recovery is processing, so we could make the removal
policy more aggressive.
--
Michael

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Alvaro Herrera 2018-03-14 13:49:58 Re: Too many .history file in pg_xlog takes lots of space
Previous Message 彭昱傑 2018-03-14 06:12:47 Re: Too many .history file in pg_xlog takes lots of space