Re: could not truncate directory "pg_serial": apparent wraparound

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: could not truncate directory "pg_serial": apparent wraparound
Date: 2011-06-09 12:14:25
Message-ID: 4DF072D1020000250003E418@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Heikki Linnakangas wrote:

> While testing this, I noticed another serious bug in the
> OldSerXidSLRU handling: we never set the dirty-flag on any page.

Arg. I never noticed that there was such a thing, although in
retrospect I should have suspected it and gone hunting for it.

> I believe the reason we haven't bumped into this in testing before
> is that when a new page is initialized, it's marked as dirty, so
> everything goes smoothly when we modify recently-zeroed pages.

Sounds plausible.

> But if a page falls out of the cache, and is later read back in and
> modified, the modifications are lost.
>
> The comments in SLRU could be more explicit about this. It was
> coincidental that I started to wonder where the pages are marked as
> dirty, I somehow thought the SLRU functions do that for you.

Yeah -- me, too.

> Fortunately the fix is very simple, we just need to set the
> page_dirty flag whenever we modify an slru page.

OK.

> But clearly this slru stuff needs more testing. It's pretty hard to
> write good repeatable test cases for these things, though.

Yeah, that is the problem.

Thanks for finding this. Is there anything you would like me to do
in this area right now, or are you on it?

-Kevin

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-06-09 12:50:33 Re: SLRU limits
Previous Message Magnus Hagander 2011-06-09 12:12:59 Re: .gitignore for some of cygwin files