pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tomas Vondra <tv@fuzzy.cz>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Thom Brown <thom@linux.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: change in LOCK behavior
Date: Wed, 10 Oct 2012 19:10:22 -0400
Message-ID: <12761.1349910622@sss.pgh.pa.us> (raw)
In-Reply-To: <5075DFC2.9090306@fuzzy.cz>
References: <5075D8DF.6050500@fuzzy.cz>
	<CAA-aLv4PF-gM6mt4ZP4GnKGkZE1fheVeUC=8jQCgzvWbaA8+mQ@mail.gmail.com>
	<5075DFC2.9090306@fuzzy.cz>

Tomas Vondra <tv@fuzzy.cz> writes:
> On 10.10.2012 22:43, Thom Brown wrote:
>> On 10 October 2012 21:21, Tomas Vondra <tv@fuzzy.cz> wrote:
>>> A: BEGIN;
>>> A: LOCK x IN ACCESS EXCLUSIVE MODE;
>>> A: INSERT INTO x VALUES (100);
>>> B: SELECT * FROM x;
>>> A: COMMIT;
>>> 
>>> Now on 9.1, B receives the value "100" while on 9.2 it gets no rows.
>>> 
>>> Is this expected? I suspect the snapshot is read at different time or
>>> something, but I've checked release notes but I haven't seen anything
>>> relevant.
>>> 
>>> Without getting the commited version of data, the locking is somehow
>>> pointless for us (unless using a different lock, not the table itself).

>> I suspect it's this commit: d573e239f03506920938bf0be56c868d9c3416da
>> http://archives.postgresql.org/pgsql-committers/2011-12/msg00167.php

> Maybe, the description suggests it might be related. I'm still not sure
> whether this is a bug or expected behavior, although the commit clearly
> states that the change shouldn't be user-visible.

Yeah, I think that last is the key point: this patch was sold on the
grounds that it wouldn't cause any interesting user-visible behavioral
change, but your example blows that claim into tiny little pieces.

I'm inclined to think we need to revert this.  The performance gain is
not worth the prospect of breaking a lot of applications that used to
work reliably.  Robert?

			regards, tom lane




view thread (38+ messages)  latest in thread

Message-ID: <12761.1349910622@sss.pgh.pa.us>
Permalink:  ../12761.1349910622@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/12761.1349910622@sss.pgh.pa.us

 · 

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-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, tv@fuzzy.cz, robertmhaas@gmail.com, thom@linux.com
  Subject: Re: change in LOCK behavior
  In-Reply-To: <12761.1349910622@sss.pgh.pa.us>
  References: <5075D8DF.6050500@fuzzy.cz> <CAA-aLv4PF-gM6mt4ZP4GnKGkZE1fheVeUC=8jQCgzvWbaA8+mQ@mail.gmail.com> <5075DFC2.9090306@fuzzy.cz> <12761.1349910622@sss.pgh.pa.us>

* 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