public inbox for [email protected]  
help / color / mirror / Atom feed
From: Hannah Huang <[email protected]>
To: Peter Geoghegan <[email protected]>
Cc: [email protected]
Subject: Re: Confusions regards serializable transaction
Date: Fri, 4 Sep 2020 16:05:50 +1000
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAH2-WzkdNKZ+fZ9r+98ZbYR7iV4x7NJr6sh6og=R3xge5fUVvQ@mail.gmail.com>
References: <[email protected]>
	<CAH2-WzkdNKZ+fZ9r+98ZbYR7iV4x7NJr6sh6og=R3xge5fUVvQ@mail.gmail.com>



> On 4 Sep 2020, at 2:21 pm, Peter Geoghegan <[email protected]> wrote:
> 
> On Thu, Sep 3, 2020 at 5:20 PM Hannah Huang <[email protected]> wrote:
>> I’m confused about what will trigger the serializable error. My test environment is PG v12.
>> 
>> This is how you can produce the test table:
> 
> Serializable isolation level promises to emulate serial transaction
> execution for all committed transactions. I believe that your example
> does not show behavior that breaks that specific promise.
> 
> -- 
> Peter Geoghegan

Hi Peter,
Thank you very much for replying my question.

My confusion is actually:

Transaction B updated the n value of  id 2, while transaction A needs to update n value for id 1 referencing the n value of id 2.

If the transaction is executed in a serialized way, then the n value of id 2 will be changed in transaction B first, and the change will be reflected in the value of id 1in transaction A. However, the two transactions are not executed concurrently - transaction A executed successfully without seeing changes made in transaction B. Is that a break of serializable isolation level?

Thanks,
Hannah




view thread (4+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Confusions regards serializable transaction
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox