Re: New FSM patch

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: New FSM patch
Date: 2008-09-18 22:37:26
Message-ID: 6057.1221777446@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I did some editorializing on the FSM README file, in the line of
familiarizing myself with the contents. Attached is an updated version.

Here are a couple of other random comments I jotted in the process:

search_avail makes me nervous: in the presence of a corrupt tree
I think it could index off the end of the page. There needs to be
protection against trying to access a leaf node that doesn't exist.
(The search upward is okay because it cannot "miss" the root, and
you already checked the root is big enough; but a comment about
that wouldn't hurt.) Also, I think it shouldn't throw a hard error
if the tree is corrupt, but just elog(LOG) and take corrective action.

I'd be happier if "next" were declared as int, as that makes it more
likely to be atomically fetchable/storable than if it's int16. (On some
platforms a partial-word store is done by read, modify, write of a full
word.) And could we name it something less generic than "next"?

The functions in fsmpage.c have names that are far too generic to be
exposed as global symbols. If you don't want to fold that file into
freespace.c and make them static, then you need to rename them.

regards, tom lane

Attachment Content-Type Size
unknown_filename text/plain 6.8 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2008-09-18 22:58:36 Re: Where to Host Project
Previous Message Steve Crawford 2008-09-18 20:32:34 Re: Do we really need a 7.4.22 release now?