public inbox for [email protected]  
help / color / mirror / Atom feed
Serializable description seems misleading?
2+ messages / 2 participants
[nested] [flat]

* Serializable description seems misleading?
@ 2019-12-10 21:49  PG Doc comments form <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Doc comments form @ 2019-12-10 21:49 UTC (permalink / raw)
  To: [email protected]; +Cc: [email protected]

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/12/transaction-iso.html
Description:

Let's say I have two transactions running in Serializable isolation:
T1: Reads a row
T2: Reads the same row
T1: Updates the row
T1: Commits
T2: Commits

You will not get an error on the second commit. These appear to fit the
description of concurrent transactions, and running one before the other
would give different results in the reading of the row by T2, depending on
which transaction was executed first. So how does this square with the docs
that state "it monitors for conditions which could make execution of a
concurrent set of serializable transactions behave in a manner inconsistent
with all possible serial (one at a time) executions".

This seems quite misleading, but I understand there may just be an aspect of
this that I am not understanding.


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Serializable description seems misleading?
@ 2019-12-11 04:06  Thomas Munro <[email protected]>
  parent: PG Doc comments form <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Thomas Munro @ 2019-12-11 04:06 UTC (permalink / raw)
  To: [email protected]; [email protected]

On Wed, Dec 11, 2019 at 11:27 AM PG Doc comments form
<[email protected]> wrote:
> Page: https://www.postgresql.org/docs/12/transaction-iso.html
> Description:
>
> Let's say I have two transactions running in Serializable isolation:
> T1: Reads a row
> T2: Reads the same row
> T1: Updates the row
> T1: Commits
> T2: Commits
>
> You will not get an error on the second commit. These appear to fit the
> description of concurrent transactions, and running one before the other
> would give different results in the reading of the row by T2, depending on
> which transaction was executed first. So how does this square with the docs
> that state "it monitors for conditions which could make execution of a
> concurrent set of serializable transactions behave in a manner inconsistent
> with all possible serial (one at a time) executions".

It only has to be consistent with *one* serial ordering of the
transactions to be allowed, not all serial orderings.  In this case,
the observed values and effects are consistent with T2 running before
T1.

> This seems quite misleading, but I understand there may just be an aspect of
> this that I am not understanding.

Do you think that wording could be improved?






^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2019-12-11 04:06 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-12-10 21:49 Serializable description seems misleading? PG Doc comments form <[email protected]>
2019-12-11 04:06 ` Thomas Munro <[email protected]>

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