Removing cruft in access/transam/xact.c - Mailing list pgsql-patches

From Alvaro Herrera
Subject Removing cruft in access/transam/xact.c
Date
Msg-id 20040327034531.GA24128@dcc.uchile.cl
Whole thread Raw
Responses Re: Removing cruft in access/transam/xact.c
List pgsql-patches
Patchers,

This patch removes the unnecesary TRANS_* states that supposedly
represented "low level transaction state".  The state is actually
unnecesary because the states can be accurately represented using the
TBLOCK_* states.  This simplifies the code somewhat.

It also allows the state machinery to be actually represented as a
directed graph.  If you look closely you'll see that the first graph I
posted yesterday was missing the StartTransactionCommand stuff; it
wasn't representable in an obvious ways.  This patch corrects that, by
adding a new TBLOCK_STARTED state.

I also attach the graph that represents this machinery.  Don't add this
to the source; it will probably be better to add the .dot source file.

I also removed some #ifdef NOT_USED code, and the IsTransactionState()
function, which can be replaced by IsTransactionOrTransactionBlock().
Maybe the latter can be renamed ...

This passes the full regression test suite.  Please review and apply if
OK.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"I think my standards have lowered enough that now I think 'good design'
is when the page doesn't irritate the living f*ck out of me." (JWZ)

Attachment

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: compiling with ssl without thread safety still broken
Next
From: Claudio Natoli
Date:
Subject: Re: APC/socket fix (final?)