Re: Automatic cleanup of oldest WAL segments with pg_receivexlog

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Automatic cleanup of oldest WAL segments with pg_receivexlog
Date: 2017-02-23 20:37:41
Message-ID: d531939a-75a0-a1d4-2941-2cf72e3f71e4@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2/23/17 10:10 AM, Magnus Hagander wrote:
> Wouldn't this one, along with some other scenarios, be better provided
> by the "run command at end of segment" function that we've talked about
> before? And then that external command could implement whatever aging
> logic would be appropriate for the environment?

That kind of API lead to difficulties with archiving direct from the
database, so I'm not sure it's the best way to go.

ISTM what's really needed is a good way for users to handle retention
for both WAL as well as base backups. A tool that did that would need to
understand what WAL is required to safely restore a base backup. It
should be possible for users to have a separate retention policy for
just base backups as well as backups that support full PITR. You'd also
need an easy way to deal with date ranges (so you can do things like
"delete all backups more than 1 year old").

Perhaps a good starting point would be a tool that lets you list what
base backups you have, what WAL those backups need, when the backups
were taken, etc.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2017-02-23 20:51:48 Re: Index corruption with CREATE INDEX CONCURRENTLY
Previous Message Jim Nasby 2017-02-23 20:26:07 Re: A typo in mcxt.c