Re: BUG #7902: lazy cleanup of extraneous WAL files can cause out of disk issues

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: "jeff(at)pgexperts(dot)com" <jeff(at)pgexperts(dot)com>
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #7902: lazy cleanup of extraneous WAL files can cause out of disk issues
Date: 2013-02-26 16:41:19
Message-ID: CAMkU=1y0k5tfqTAKCPwSd_uAyhpW6hBRbFxTvqQHGe4rQL9p9Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Friday, February 22, 2013, wrote:

> The following bug has been logged on the website:
>
> Bug reference: 7902
> Logged by: Jeff Frost
> Email address: jeff(at)pgexperts(dot)com <javascript:;>
> PostgreSQL version: 9.2.3
> Operating system: Ubuntu 12.04
> Description:
>
> While doing acceptance testing on a new Ubuntu 12.04 PostgreSQL server
> running 9.2.3, we set checkpoint_segments = 128,
> checkpoint_completion_target = 0.9 and placed pg_xlog on a separate 20G
> partition. Also, archive_mode = off on this system.
>
> According to the docs, you would expect the system to attempt to keep the
> WAL files down close to 3 * checkpoint_segments + 1.

Assuming checkpoints are driven by checkpoint_segments and not time or
manual checkpoints, this actually seems to be an error in the docs. What
it brings it back down to is something more like
(3 + checkpoint_completion_target) * checkpoint_segments + 1.

At the point in the code where it does the removal, it has all of the logs
since the start of the just-finished checkpoint
(completion_target*checkpoint_segments) that can't be removed, all of the
logs since the start of the checkpoint before that one
(=checkpoint_segments) that can't be removed, plus it will recycle enough
to have checkpoint_segments*2+1 future logs before it removes the rest.

But this describes what happens once things have gotten out of control but
then calms down again. In your case it never does calm down again.

Cheers,

Jeff

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Jeff Janes 2013-02-26 17:08:36 Re: BUG #7902: lazy cleanup of extraneous WAL files can cause out of disk issues
Previous Message ibrahimkocaoglutr 2013-02-26 08:30:05 BUG #7907: BEFORE DELETE TRIGGER (not instead of, my trigger BEFORE)not row delete...