Skip site navigation (1) Skip section navigation (2)

RE: AW: Re: [SQL] possible row locking bug in 7.0.3 & 7.1

From: "Mikheev, Vadim" <vmikheev(at)SECTORBASE(dot)COM>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Zeugswetter Andreas SB <ZeugswetterA(at)Wien(dot)Spardat(dot)at>
Cc: "'Hiroshi Inoue'" <Inoue(at)tpf(dot)co(dot)jp>, Philip Warner <pjw(at)rhyme(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: RE: AW: Re: [SQL] possible row locking bug in 7.0.3 & 7.1
Date: 2001-03-30 20:02:34
Message-ID: 8F4C99C66D04D4118F580090272A7A234D3361@sectorbase1.sectorbase.com (view raw or flat)
Thread:
Lists: pgsql-hackers
> > It is intuitive. The bug was iirc, that you saw 2 versions 
> > of the same row in the second select statement (= 2 rows
> > returned by second select).
> 
> I think we should be extremely wary of assuming that we have a clear
> characterization of "what the bug is", let alone "how to fix it".
> The real issue here is that SELECT has different MVCC visibility rules
> from UPDATE and SELECT FOR UPDATE.  I suspect that that *must* be so

This is not correct - SELECT has same rules. Are you able to reproduce
this bad behaviour without running queries in functions? I assume
the answer is NO. I just overlooked function case two years ago.
But SELECT/UPDATE visibility rules are same!
Ever wonder why in SERIALIZABLE mode UPDATE/SELECT_FOR_UPDATE cause
rollback in the event of concurrent modification? Because of concurrent
modifications make visibility of SELECT and UPDATE different and this
means *unconsistent* view of database for applications.
In READ COMMITTED mode a query must see changes made by previous
queries - the only one rule we have to follow to provide consistent
result for applications.

> in any mode that allows more concurrency than full serializable mode.
> Thus, the question we are really facing is how we might alter the
> visibility rules in a way that will make the results more intuitive
> and/or useful while still allowing concurrency.
> 
> This will take thought, research and discussion.  A quick fix is the
> last thing that should be on our minds.

I agreed to leave it as Known Bug for 7.1.

> A first question: where did the MVCC rules come from 
> originally, anyway?

From the fact that I've used Oracle before Postgres'95,
liked it and had time to read its documentation -:)

> Is there any academic research to look at?

There is academic Theorem of Serializability but it's
different from SERIALIZABLE mode definitions in standard.
Probably, this difference was caused by lobbying from
Oracle...

Vadim

Responses

pgsql-hackers by date

Next:From: Mikheev, VadimDate: 2001-03-30 20:08:44
Subject: RE: AW: Re: [SQL] possible row locking bug in 7.0.3 & 7 .1
Previous:From: Tom LaneDate: 2001-03-30 19:55:04
Subject: 7.1 pg_dump fails for user-defined types (release stopper?)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group