Re: [BUGS] Status of issue 4593

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Robert Haas" <robertmhaas(at)gmail(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Peter Eisentraut" <peter_e(at)gmx(dot)net>, "Jeff Davis" <pgsql(at)j-davis(dot)com>, "Lee McKeeman" <lmckeeman(at)opushealthcare(dot)com>, "PG Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUGS] Status of issue 4593
Date: 2009-01-12 18:45:40
Message-ID: 496B3B74.EE98.0025.0@wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

>>> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> A re-sort after locking doesn't really make things all nice and
> intuitive either. Suppose that the values of X are 10,20,30,40,50
> and we do SELECT ... ORDER BY x LIMIT 3 FOR UPDATE. Concurrently
> someone updates the 20 to 100. The existing code locks the 10,20,30
> rows, then notices the 20 got updated to 100, and returns you
> 10,100,30. If it re-sorted you would get 10,30,100, but on what
> grounds is that the correct answer and not 10,20,40? If you want
> to argue that 10,20,40 is the correct answer, how are you going to
> arrive at it without locking more rows than are returned?

Would it make any sense to roll back and generate a
SERIALIZATION_FAILURE? In other databases I've seen this failure
code used for all situations where they can't perform the requested
operation due to concurrent transactions, regardless of transaction
isolation level.

That seems more intuitive to me than any of the alternatives discussed
so far, which all seem to involve quietly returning something other
than what was specified.

-Kevin

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2009-01-12 18:51:15 Re: [BUGS] Status of issue 4593
Previous Message Tom Lane 2009-01-12 18:35:28 Re: [BUGS] Status of issue 4593

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-01-12 18:51:15 Re: [BUGS] Status of issue 4593
Previous Message Heikki Linnakangas 2009-01-12 18:43:23 Re: Recovery Test Framework