pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Simon Riggs <simon@2ndQuadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Tomas Vondra <tv@fuzzy.cz>
Cc: Thom Brown <thom@linux.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: change in LOCK behavior
Date: Thu, 11 Oct 2012 14:41:58 -0400
Message-ID: <24391.1349980918@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+U5nMLkHys0NJNhu7YkOPGGVKhPFqZ=24-cyUvtGHsxhL6DBw@mail.gmail.com>
References: <5075D8DF.6050500@fuzzy.cz>
	<CAA-aLv4PF-gM6mt4ZP4GnKGkZE1fheVeUC=8jQCgzvWbaA8+mQ@mail.gmail.com>
	<5075DFC2.9090306@fuzzy.cz>
	<12761.1349910622@sss.pgh.pa.us>
	<CA+TgmoZjLV2J44-WD5w0VhuXoPzfaY7_p5nTi6y73w9898-vMA@mail.gmail.com>
	<14951.1349916214@sss.pgh.pa.us>
	<CA+U5nMJaNqPNWcaD+T03FgD_USM7k5YGh2zsFn7pprVJLRjJbA@mail.gmail.com>
	<19901.1349974420@sss.pgh.pa.us>
	<CA+U5nMJhhTG8i41c4HNcHJYcD=m8xdem=6tPFhUDMv6niy1Gkg@mail.gmail.com>
	<21922.1349976162@sss.pgh.pa.us>
	<CA+U5nMLkHys0NJNhu7YkOPGGVKhPFqZ=24-cyUvtGHsxhL6DBw@mail.gmail.com>

Simon Riggs <simon@2ndQuadrant.com> writes:
> On 11 October 2012 18:22, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> If it worked, I might be amenable to that, but it doesn't.  You can't
>> trigger taking a new snapshot off whether we waited for a lock; that
>> still has race conditions, just ones that are not so trivial to
>> demonstrate manually.  (The other transaction might have committed
>> microseconds before you reach the point of waiting for the lock.)

> So where's the race?

Same example as before, except that the exclusive-lock-holding
transaction commits (and releases its lock) between the time that the
other transaction takes its parse/plan snapshot and the time that it
takes AccessShare lock on the table.

			regards, tom lane




view thread (38+ messages)  latest in thread

Message-ID: <24391.1349980918@sss.pgh.pa.us>
Permalink:  ../24391.1349980918@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/24391.1349980918@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, simon@2ndQuadrant.com, robertmhaas@gmail.com, tv@fuzzy.cz, thom@linux.com
  Subject: Re: change in LOCK behavior
  In-Reply-To: <24391.1349980918@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> <CA+TgmoZjLV2J44-WD5w0VhuXoPzfaY7_p5nTi6y73w9898-vMA@mail.gmail.com> <14951.1349916214@sss.pgh.pa.us> <CA+U5nMJaNqPNWcaD+T03FgD_USM7k5YGh2zsFn7pprVJLRjJbA@mail.gmail.com> <19901.1349974420@sss.pgh.pa.us> <CA+U5nMJhhTG8i41c4HNcHJYcD=m8xdem=6tPFhUDMv6niy1Gkg@mail.gmail.com> <21922.1349976162@sss.pgh.pa.us> <CA+U5nMLkHys0NJNhu7YkOPGGVKhPFqZ=24-cyUvtGHsxhL6DBw@mail.gmail.com> <24391.1349980918@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