Re: walwriter not closing old files

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: walwriter not closing old files
Date: 2010-06-09 12:12:06
Message-ID: AANLkTik8_V1utALaZlfvHznScHuBItE41NphcaMIE4LF@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jun 9, 2010 at 14:04, Kevin Grittner
<Kevin(dot)Grittner(at)wicourts(dot)gov> wrote:
> Magnus Hagander  wrote:
>
>> I've just applied the attached file to the walwriter, to solve a
>> case when it keeps handles around to old xlog segments, preventing
>> them from actually being removed, and as such also causing alerts
>> in some monitoring systems.
>
> Thanks!  I wasted some time on these a while back; I'm sure this will
> save others that kind of bother.
>
>> The way to provoke the problem is:
>
> The way I ran into it was to have a web application which only ran
> read-only transactions.  Sooner or later it would need to write a
> page from the buffer to make space to read a new page, and then it
> would forever be holding a WAL file open, even after it was deleted.
>
> Previous thread on the topic starts here:
>
> http://archives.postgresql.org/pgsql-hackers/2009-11/msg01754.php
>
> continuing here:
>
> http://archives.postgresql.org/pgsql-hackers/2009-12/msg00060.php
>
> Resulting in a TODO listed with this description:
>
> Close deleted WAL files held open in *nix by long-lived read-only
> backends

That seems to be about the same, but not actually fixed by this one.
This fix *only* fixes it when this happens in the walwriter. Not in
regular backends. OTOH, this happened in non-readonly mode :) My
understanding is that the issue you're talking about happens with the
regular backends, not walwriter, right?

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2010-06-09 12:12:50 Re: walwriter not closing old files
Previous Message Kevin Grittner 2010-06-09 12:04:09 Re: walwriter not closing old files