Re: BUG #7902: lazy cleanup of extraneous WAL files can cause out of disk issues - Mailing list pgsql-bugs

From Jeff Janes
Subject Re: BUG #7902: lazy cleanup of extraneous WAL files can cause out of disk issues
Date
Msg-id CAMkU=1y0k5tfqTAKCPwSd_uAyhpW6hBRbFxTvqQHGe4rQL9p9Q@mail.gmail.com
Whole thread Raw
In response to BUG #7902: lazy cleanup of extraneous WAL files can cause out of disk issues  (jeff@pgexperts.com)
List 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@pgexperts.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

pgsql-bugs by date:

Previous
From: Maciek Sakrejda
Date:
Subject: Re: BUG #7883: "PANIC: WAL contains references to invalid pages" on replica recovery
Next
From: Jeff Janes
Date:
Subject: Re: BUG #7902: lazy cleanup of extraneous WAL files can cause out of disk issues