Re: autonomous transactions (was Re: TODO note)

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Darren Duncan <darren(at)darrenduncan(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Colin 't Hart <colinthart(at)gmail(dot)com>
Subject: Re: autonomous transactions (was Re: TODO note)
Date: 2010-09-15 22:21:36
Message-ID: 1284589049-sup-6998@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Excerpts from Robert Haas's message of mié sep 15 14:57:29 -0400 2010:

> I guess so, but the devil is in the details. I suspect that we don't
> actually want to fork a new backend for every autonomous transactions.
> That would be pretty expensive, and we already have an expensive way
> of emulating this functionality using dblink. Finding all of the bits
> that think there's only one top-level transaction per backend and
> generalizing them to support multiple top-level transactions per
> backend doesn't sound easy, though,

Yeah, and the transaction handling code is already pretty complex.

> especially since you must do it without losing performance.

Presumably we'd have fast paths for the main transaction, and
any autonomous transactions beside that one would incur in some
slowdown.

I think the complex parts are, first, figuring out what to do with
global variables that currently represent a transaction (they are
sprinkled all over the place); and second, how to represent the
autonomous transactions in shared memory without requiring the PGPROC
array to be arbitrarily resizable.

The other alternative would be to bolt the autonomous transaction
somehow in the current subtransaction stack thing and marking it in some
different way so that we can reuse the games we play with "push/pop"
there. That still leaves us with the PGPROC problem.

--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-09-15 22:36:56 RelationCreateStorage can orphan files
Previous Message Simon Riggs 2010-09-15 21:18:27 Re: Sync Replication with transaction-controlled durability