CatCache state reversing - Mailing list pgsql-hackers

From Alvaro Herrera
Subject CatCache state reversing
Date
Msg-id 20040514235342.GA27354@dcc.uchile.cl
Whole thread Raw
Responses Re: CatCache state reversing  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hackers,

In looking at the CatCache code it's clear to me that there's no point
in copying the whole structure like I did to the Relcache; it's much
bigger, and there's not much that can change inside a subtransaction:
CatCacheRemoveCTup can't be called, because ReleaseCatCache will not be
called more times than SearchCatCache was called.  So it can, at most,
end with the same number of references.

What I'm currently thinking is that for each entry in the cache, we'll
save the current refcount at subtransaction start, and then restore it
at subtransaction abort.  At subtransaction commit, the parent's
refcount will be updated with the subtransaction's refcount, which can
be greater than zero.

This will be done by adding an int* member to the catctup and catclist
structs, and keeping the integers there.

Comments?

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"People get annoyed when you try to debug them."  (Larry Wall)


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Feature freeze approaching
Next
From: Tom Lane
Date:
Subject: Re: relcache refcount