On 09 April 2014 01:09, Rover Haas Wrote:
> I'm also pretty unconvinced that multiple PGPROCs is the right way to
> go. First, PGPROCs have a bunch of state in them that is assumed to
> exist once per backend. We might find pretty substantial code churn
> there if we try to go change that.
Yes you right. That is why I am not creating a separate procarray entry to
maintain autonomous transaction. Please find details in previous reply sent
today sometime back.
> Second, why do other backends
> really need to know about our ATs? As far as I can see, if other
> backends see the AT as a subtransaction of our top-level transaction up
> until it actually commits, that ought to be just fine. Maybe the
> backend needs to internally frob visibility rules, but that's not a
> matter for shared memory.
In order to get snapshot from other session, it will be required by other
session to access autonomous transaction and their sub-transactions.
During snapshot creation, autonomous transaction is considered as main
transaction and list of all running autonomous transaction and their sub-transaction
gets stored in snapshot data.
e.g. Suppose below processes are running with given transactions:
Proc-1: 100
Proc-2: 101, 102 (Auto Tx1), 103 (Auto Tx2), 104 (Sub-tx of Auto Tx2)
Proc-3: 105, 106 (Auto Tx2), 107 (Auto Tx2)
Suppose latest completed transaction is 108.
Then Snapshot data for autonomous transaction 107 will be as below:
Xmin: 100
Xmax: 109
Snapshot->xip[]: 100, 101, 102, 103, 105, 106
Snapshot->subxip[]: 104
Thanks and Regards,
Kumar Rajeev Rastogi