Re: Trimming transaction logs after extended WAL archive failures

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Steven Schlansker <steven(at)likeness(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org postgresql" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Trimming transaction logs after extended WAL archive failures
Date: 2014-03-26 01:33:03
Message-ID: CAMkU=1xNSLU_h5Tgg4CptsT5aROo6243MwJ0WWW05oGeVOAz9A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tuesday, March 25, 2014, Steven Schlansker <steven(at)likeness(dot)com> wrote:

> Hi everyone,
>
> I have a Postgres 9.3.3 database machine. Due to some intelligent work on
> the part of someone who shall remain nameless, the WAL archive command
> included a '> /dev/null 2>&1' which masked archive failures until the disk
> entirely filled with 400GB of pg_xlog entries.
>

PostgreSQL itself should be logging failures to the server log, regardless
of whether those failures log themselves.

> I have fixed the archive command and can see WAL segments being shipped
> off of the server, however the xlog remains at a stable size and is not
> shrinking. In fact, it's still growing at a (much slower) rate.
>

The leading edge of the log files should be archived as soon as they fill
up, and recycled/deleted two checkpoints later. The trailing edge should
be archived upon checkpoints and then recycled or deleted. I think there
is a throttle on how many off the trailing edge are archived each
checkpoint. So issues a bunch of "CHECKPOINT;" commands for a while and
see if that clears it up.

Cheers,

Jeff

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2014-03-26 02:58:59 Re: Trimming transaction logs after extended WAL archive failures
Previous Message Adrian Klaver 2014-03-26 00:20:06 Re: Failure upgrading PG 9.2 to 9.3