Re: Autonomous Transaction is back

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Autonomous Transaction is back
Дата
Msg-id 55B6B703.2050805@agliodbs.com
обсуждение исходный текст
Ответ на Autonomous Transaction is back  (Rajeev rastogi <rajeev.rastogi@huawei.com>)
Ответы Re: Autonomous Transaction is back  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Re: Autonomous Transaction is back  (Joel Jacobson <joel@trustly.com>)
Список pgsql-hackers
On 07/27/2015 03:12 PM, Joel Jacobson wrote:
> On Mon, Jul 27, 2015 at 11:49 PM, Josh Berkus <josh@agliodbs.com
> <mailto:josh@agliodbs.com>> wrote:
> 
>     Ah, you're missing how commits in ATX are expected to work.  Let me
>     illustrate:
> 
>     X (
>        Data write A1
>        call Y(
>             Start ATX
>             Data write B1
>             Commit ATX
>        )
>        Data write A2
>        Exception
>     )
> 
>     In this workflow, B1 would be committed and persistent. Neither A1 nor
>     A2 would be committed, or visible to other users.  Depending on what
>     implementation we end up with, A1 might not even be visible to Y().
> 
>     So that solves your use case without any need to "block" ATXs in called
>     functions.  However, it leads to some interesting cases involving
>     self-deadlocks; see the original post on this thread.
> 
> 
> I don't follow. In your example above, if I'm X(), how do I ensure Y()
> won't have committed anyting at all when I later at "Exception" decide
> to rollback everything from "Data write A1" to "Data write A2" including
> any writes made by Y() (in the example "Data write B1")?

Ah, ok.  The goal of the project is that the writer of X() *cannot*
prevent Y() from writing its data (B1) and committing it.

One of the primary use cases for ATX is audit triggers.  If a function
writer could override ATX and prevent the audit triggers from
committing, then that use case would be violated.

Can you explain what use case you have where simply telling the staff
"if you use ATX without clearing it, you'll be fired" is not sufficient?Possibly there's something we failed to account
forin the unconference
 
discussion.

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jim Nasby
Дата:
Сообщение: Re: optimizing vacuum truncation scans
Следующее
От: David Rowley
Дата:
Сообщение: Re: WIP: Make timestamptz_out less slow.