From: Nikita Volkov <nikita.y.volkov@mail.ru>
To: Merlin Moncure <mmoncure@gmail.com>
Cc: Kevin Grittner <kgrittn@ymail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: BUG #12330: ACID is broken for unique constraints
Date: Mon, 29 Dec 2014 18:48:53 +0300
Message-ID: <CACvKsMFr2JjUKUy_EsJS6RThM7Qk7G-RfsmhfUzhF8T2GNwLcQ@mail.gmail.com> (raw)
In-Reply-To: <CAHyXU0ye_RT0VsTyup=u-Y5xoE7TpN9k9LTJ4RegmSfgZpiwyA@mail.gmail.com>
References: <CAHyXU0zr42rgGuqB6=5fW6TEw8183s89U-2epXJ1Me8WDW=RRw@mail.gmail.com>
<534827646.1373406.1419865749409.JavaMail.yahoo@jws100110.mail.ne1.yahoo.com>
<CAHyXU0ye_RT0VsTyup=u-Y5xoE7TpN9k9LTJ4RegmSfgZpiwyA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
I believe, the objections expressed in this thread miss a very important
point of all this: the isolation property (the "I" in ACID) is violated.
Here’s a quote from the Wikipedia article on ACID
<http://en.wikipedia.org/wiki/ACID;:
The isolation property ensures that the concurrent execution of
transactions results in a system state that would be obtained if
transactions were executed serially, i.e., one after the other.
The original example proves that it's violated. Such behaviour can neither
be expected by a user, nor is even mentioned anywhere. Instead in the first
paragraph of the “About” section of the Postgres site
<http://www.postgresql.org/about/; it states:
It is fully ACID compliant
Which is basically just a lie, until issues like this one get dealt with.
2014-12-29 18:31 GMT+03:00 Merlin Moncure <mmoncure@gmail.com>:
> On Mon, Dec 29, 2014 at 9:09 AM, Kevin Grittner <kgrittn@ymail.com> wrote:
> > Merlin Moncure <mmoncure@gmail.com> wrote:
> >> In other words, the current behavior is:
> >> txn A,B begin
> >> txn A inserts
> >> txn B inserts over A, locks, waits
> >> txn A commits. B aborts with duplicate key error
> >
> > What I'm proposing is that for serializable transactions B would
> > get a serialization failure; otherwise B would get a duplicate key
> > error. If the retry of B looks at something in the database to
> > determine what it's primary key should be it will get a new value
> > on the retry, since it will be starting after the commit of A. If
> > it is using a literal key, not based on something changed by A, it
> > will get a duplicate key error on the retry, since it will be
> > starting after the commit of A.
> >
> > It will either succeed on retry or get an error for a different
> > reason.
>
> In that case: we don't agree. How come duplicate key errors would be
> reported as serialization failures but not RI errors (for example,
> inserting a record pointing to another record which a concurrent
> transaction deleted)?
>
> IMO, serialization errors are an implementation artifact and should
> not mask well defined errors in SQL under any circumstances (or if
> they must, those cases should absolutely be as narrow as possible).
>
> merlin
>
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: nikita.y.volkov@mail.ru, mmoncure@gmail.com, kgrittn@ymail.com, tgl@sss.pgh.pa.us, josh@agliodbs.com, pgsql-hackers@postgresql.org
Subject: Re: BUG #12330: ACID is broken for unique constraints
In-Reply-To: <CACvKsMFr2JjUKUy_EsJS6RThM7Qk7G-RfsmhfUzhF8T2GNwLcQ@mail.gmail.com>
References: <CAHyXU0zr42rgGuqB6=5fW6TEw8183s89U-2epXJ1Me8WDW=RRw@mail.gmail.com> <534827646.1373406.1419865749409.JavaMail.yahoo@jws100110.mail.ne1.yahoo.com> <CAHyXU0ye_RT0VsTyup=u-Y5xoE7TpN9k9LTJ4RegmSfgZpiwyA@mail.gmail.com> <CACvKsMFr2JjUKUy_EsJS6RThM7Qk7G-RfsmhfUzhF8T2GNwLcQ@mail.gmail.com>
* 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