Re: Relation forks & FSM rewrite patches

From: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
To: "Simon Riggs" <simon(at)2ndquadrant(dot)com>
Cc: "pgsql-patches" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Relation forks & FSM rewrite patches
Date: 2008-07-04 09:27:55
Message-ID: 486DED1B.4020202@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Simon Riggs wrote:
> On Fri, 2008-06-27 at 19:36 +0300, Heikki Linnakangas wrote:
>
>> Here's an updated version of the "relation forks" patch, and an
>> incremental FSM rewrite patch on top of that. The relation forks patch
>> is ready for review. The FSM implementation is more work-in-progress
>> still, but I'd like to get some review on that as well, with the goal of
>> doing more performance testing and committing it after the commit fest.
>
> Hmmm, a 6000 line page with no visible documentation, readme, nor any
> discussion on -hackers that I'm aware of.

There is a readme in the patch, and there certainly has been discussion
on -hackers, see:

http://archives.postgresql.org/pgsql-hackers/2008-04/msg00415.php

where the current design is discussed for the first time.

User documentation is still to be done. There isn't anything to tune, or
anything that requires manual maintenance, so there isn't much to
document, though, except perhaps a chapter in the "Internals" part.

Here's an updated version of the patch. Changes:
- one bug has been fixed (I assumed that it's always safe to call
rightchild(x) on a parent node, but that was not always true for the
rightmost branch of the tree)
- there's some new debugging code.
- if we can't find a page with enough free space in search_avail after
starting from scratch 1000 times, give up. That shouldn't happen, but
see below.

There is still a nasty bug somewhere, probably related to locking :-(. I
ran DBT-2 with this, and after about 1h a FSM lookup goes into an
endless loop, hogging all CPU. I suspect that there's a bug somewhere so
that a change to the root node of a lower level FSM page isn't
propagated to the upper level FSM page for some reason. oprofile shows
that the endless loop happens in search_avail. This is why I added the
code to give up after 1000 tries, hoping to get some debugging output
the next time that happens.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Zdenek Kotala 2008-07-04 09:57:47 Re: page macros cleanup (ver 03)
Previous Message Oleg Bartunov 2008-07-04 09:13:17 Re: [PATCHES] Multi-column GIN