pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Kyle Kingsbury <aphyr@jepsen.io>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Peter Geoghegan <pg@bowt.ie>
Cc: Kevin Grittner <kgrittn@gmail.com>
Cc: Jeff Davis <pgsql@j-davis.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: Potential G2-item cycles under serializable isolation
Date: Thu, 11 Jun 2020 12:54:36 -0700
Message-ID: <20200611195436.6y45fyddffazhr7r@alap3.anarazel.de> (raw)
In-Reply-To: <16b323b2-dfdb-a4c4-fd9d-7b81e52c2375@jepsen.io>
References: <d91de157-b590-dd4b-3585-79f4ece79dfa@jepsen.io>
	<CAH2-Wz=9szcV1CQk4ZTj2GOKdjzf_DAAbfXdssKJnxpdX3pL2A@mail.gmail.com>
	<CAH2-Wzk+FHVJvSS9VPPJ_K9w4xwqeVyfnkzYWtWrBzXJSJcMVQ@mail.gmail.com>
	<CAH2-Wzkk5CS2emjrftQXemjDVNkYSrUEXtHd-hoxBGsjSA01Ew@mail.gmail.com>
	<20200609021706.62lwps6uywkp4kxt@alap3.anarazel.de>
	<CAH2-Wz=n7P5S_+mJHaZa4EP3qM9CGidSvocy38hm+TLvhWp1-A@mail.gmail.com>
	<CAH2-Wzk=-gRrZP4mvsFeFN8VQDw2WNdS8AnJG8eX020Q7XSmMQ@mail.gmail.com>
	<0a53caa2-d568-0283-a448-96bd4d68c235@jepsen.io>
	<CA+hUKGJgSn+JF929bMpxhn21p0ArUwjs_RrxGKb2_6Fuu5J09w@mail.gmail.com>
	<16b323b2-dfdb-a4c4-fd9d-7b81e52c2375@jepsen.io>

Hi,

On 2020-06-11 08:39:13 -0400, Kyle Kingsbury wrote:
> On 6/11/20 1:40 AM, Thomas Munro wrote:
> > What do you think about this documentation update?
> 
> I think this is really helpful! You can go a little further if you like.
> Right now, SSI vs serializable and SI vs RR are both described as
> "differences in behavior", which kinda leaves it unclear as to how those
> levels are related. If you want to follow Berenson, Adya, et al.'s broad
> interpretation, I'd say something like
> 
> "Snapshot isolation prevents some anomalies, like phantoms, which repeatable
> read allows. It also allows some anomalies, like G2-item (write skew), which
> repeatable read prevents."

I think the percentage of readers that understand "G2-item" or even
"write skew", but don't already know what snapshot isolation implies, is
pretty close to zero. I like the idea of having a bit more detail, but I
think it'd have to be worded differently to be beneficial.

I'd also phrase it as "some definitions of repeatable read", but ... :).

Intuitively, and that's not meant as an argument for anything, I find
prohibiting write skew in something named "repeatable read" just plain
odd.  Leaving naming aside, I think there's good practical reasons for
applications using read-committed, snapshot isolation, and
serializable. It's not obvious to me that there are cases where the
Berenson definition of RR is something that's desirable to use over
RR/SI/S.


I suspect what we really want, medium term, is some guidelines around
what isolation levels are appropriate for which use-case. But that's a
nontrivial thing to write, I think, and there's lot of room for
disagreements...


Greetings,

Andres Freund





view thread (77+ messages)  latest in thread

Message-ID: <20200611195436.6y45fyddffazhr7r@alap3.anarazel.de>
Permalink:  ../20200611195436.6y45fyddffazhr7r@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20200611195436.6y45fyddffazhr7r@alap3.anarazel.de

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: andres@anarazel.de, aphyr@jepsen.io, thomas.munro@gmail.com, pg@bowt.ie, kgrittn@gmail.com, pgsql@j-davis.com
  Subject: Re: Potential G2-item cycles under serializable isolation
  In-Reply-To: <20200611195436.6y45fyddffazhr7r@alap3.anarazel.de>
  References: <d91de157-b590-dd4b-3585-79f4ece79dfa@jepsen.io> <CAH2-Wz=9szcV1CQk4ZTj2GOKdjzf_DAAbfXdssKJnxpdX3pL2A@mail.gmail.com> <CAH2-Wzk+FHVJvSS9VPPJ_K9w4xwqeVyfnkzYWtWrBzXJSJcMVQ@mail.gmail.com> <CAH2-Wzkk5CS2emjrftQXemjDVNkYSrUEXtHd-hoxBGsjSA01Ew@mail.gmail.com> <20200609021706.62lwps6uywkp4kxt@alap3.anarazel.de> <CAH2-Wz=n7P5S_+mJHaZa4EP3qM9CGidSvocy38hm+TLvhWp1-A@mail.gmail.com> <CAH2-Wzk=-gRrZP4mvsFeFN8VQDw2WNdS8AnJG8eX020Q7XSmMQ@mail.gmail.com> <0a53caa2-d568-0283-a448-96bd4d68c235@jepsen.io> <CA+hUKGJgSn+JF929bMpxhn21p0ArUwjs_RrxGKb2_6Fuu5J09w@mail.gmail.com> <16b323b2-dfdb-a4c4-fd9d-7b81e52c2375@jepsen.io> <20200611195436.6y45fyddffazhr7r@alap3.anarazel.de>

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

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