Re: Autonomous Transaction is back - Mailing list pgsql-hackers

From Ashutosh Bapat
Subject Re: Autonomous Transaction is back
Date
Msg-id CAFjFpRe5dx1aWTEin9zgAB_pkFFa9ciSUNSDRvObEQiF8Vd4ZA@mail.gmail.com
Whole thread
In response to Re: Autonomous Transaction is back  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers



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().


A1 should never be visible to Y(), else we will end up with inconsistencies. E.g.

A1 is a primary key and B1 writes a foreign key referencing A1. Commit ATX, will not complain as it sees A1, but in case X rolls back, we may have B1 referencing nothing.

Am I missing something?

--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company

pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: [DESIGN] ParallelAppend
Next
From: Andres Freund
Date:
Subject: Re: WIP: Make timestamptz_out less slow.