I attach a updated nested transactions patch. Hopefully the list server
will actually distribute it this time. I'd really like to get some
testing and comment. Does this actually work on the scenarios where
those of you who would be using it expect it to work?
In this patch, relcache and catcache reference counting is handled as
previously discussed on pgsql-hackers: each item carries a stack onto
which the current refcount is pushed when a subtransaction starts, and
it is restored if the subtransaction aborts. This is a "first cut" and
probably there some bug in the logic, but the basic cases work.
Also, Locks are released on subtrans abort based on the list of
committed child transactions, rather than relabeling at subtrans commit;
I suspect it's cheaper as we don't have to rehash the lock with the new
Main transaction commit and abort are logged with a list of committed
subtransactions. At recovery, those are marked committed or aborted.
I added some logic to the pg_subtrans code so that a subcommitted
transaction whose parent is either committed or aborted (recursively) is
marked as committed/aborted if its Xid is lesser than a cutoff point.
The cutoff is taken from the xmin calculated at GetSnapshotData, so by
the time pg_clog is modified, no transaction is running which should see
them as in-progress. Please comment on this, as the idea is new. The
change is done in TransactionIdDidCommit() and TransactionIdDidAbort()
(and so the SubtransCutoffXid is kept in transam.c, which may seem
strange but it's actually the only place where it can be).
- deferred trigger handling
- Tom mentioned buffer manager state reversing. I haven't investigated
- check that relcache and catcache code is correct. I'm almost sure
there's a bug.
Hopefully not much else.
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
Tulio: oh, para qué servirá este boton, Juan Carlos?
Policarpo: No, aléjense, no toquen la consola!
Juan Carlos: Lo apretaré una y otra vez.
Description: application/octet-stream (3.6 KB)
pgsql-patches by date
|Next:||From: Neil Conway||Date: 2004-05-23 22:20:56|
|Subject: cosmetic psql tweaks|
|Previous:||From: Tom Lane||Date: 2004-05-23 21:32:36|
|Subject: Re: Tuple sampling |