Re: CSStorm occurred again by postgreSQL8.2 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: CSStorm occurred again by postgreSQL8.2
Date
Msg-id 22080.1158198335@sss.pgh.pa.us
Whole thread Raw
In response to Re: CSStorm occurred again by postgreSQL8.2  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: CSStorm occurred again by postgreSQL8.2  (Gregory Stark <stark@enterprisedb.com>)
Re: CSStorm occurred again by postgreSQL8.2  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-hackers
I wrote:
> ... it seems like in the
> case where RecordSubTransactionCommit detects that the subxact has not
> stored its XID anywhere, we could immediately remove the XID from
> the PGPROC array, just as if it had aborted.  This would avoid chewing
> subxid slots for cases such as exception blocks in plpgsql that are
> not modifying the database, but just catching computational errors.

(and later realized that Alvaro had had the same idea awhile back, but
I don't have his message at hand).

I looked into this a bit more; it seems like basically it should only
take addition of
else    XidCacheRemoveRunningXids(xid, 0, NULL);

to the bottom of RecordSubTransactionCommit(), plus suitable adjustment
of the comments in both routines.  However, there's a problem: if we
delete a second-level subxact's XID from PGPROC, and later its upper
subtransaction aborts, XidCacheRemoveRunningXids will emit scary
warnings when it doesn't find the sub-subxact in PGPROC.  This could
doubtless be fixed with sufficient jiggery-pokery --- simply removing
the debug warnings would be a brute-force answer, but I'd like to find
something a bit less brute-force.  Maybe drop the sub-subxact from its
parent's list immediately, instead of carrying it forward?

Anyway, given that there's this one nonobvious gotcha, there might be
others.  My recommendation is that we take this off the open-items list
for 8.2 and revisit it in the 8.3 cycle when there's more time.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Mark Dilger
Date:
Subject: Re: Fixed length data types issue
Next
From: Tom Lane
Date:
Subject: Not-so-open items