pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Simon Riggs <simon@2ndquadrant.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 15:43:04 -0400
Message-ID: <25607.1349984584@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+Tgmoa0Dw-D1xV64iab9GvzVgYNzNng9v6pi8g2_B_6HwV38w@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>
	<CA+TgmoYjRaX8tqb9+phOTfRFK4ZwVs50qMds1DtsZ-6APr2QpQ@mail.gmail.com>
	<CA+U5nMKOMnBq72vW+_X14cxXpX=Q4K8oJHvnyF12yNt+KrgAGg@mail.gmail.com>
	<CA+Tgmoa0Dw-D1xV64iab9GvzVgYNzNng9v6pi8g2_B_6HwV38w@mail.gmail.com>

Robert Haas <robertmhaas@gmail.com> writes:
> So we have to take the snapshot before you begin execution, but it
> seems that to avoid surprising behavior we also have to take it after
> acquiring locks.  And it looks like locking is intertwined with a
> bunch of other parse analysis tasks that might require a snapshot to
> have been taken first.  Whee.

Yeah.  I think that a good solution to this would involve guaranteeing
that the execution snapshot is not taken until we have all locks that
are going to be taken on the tables.  Which is likely to involve a fair
amount of refactoring, though I admit I've not looked at details.

In any case, it's a mistake to think about this in isolation.  If we're
going to do something about redefining SnapshotNow to avoid its race
conditions, that's going to move the goalposts quite a lot.

Anyway, my feeling about it is that I don't want 9.2 to have an
intermediate behavior between the historical one and whatever we end up
designing to satisfy these concerns.  That's why I'm pressing for
reversion and not a band-aid fix in 9.2.  I certainly hope we can do
better going forward, but this is not looking like whatever we come up
with would be sane to back-patch.

			regards, tom lane




view thread (38+ messages)  latest in thread

Message-ID: <25607.1349984584@sss.pgh.pa.us>
Permalink:  ../25607.1349984584@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/25607.1349984584@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, robertmhaas@gmail.com, simon@2ndquadrant.com, tv@fuzzy.cz, thom@linux.com
  Subject: Re: change in LOCK behavior
  In-Reply-To: <25607.1349984584@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> <CA+TgmoYjRaX8tqb9+phOTfRFK4ZwVs50qMds1DtsZ-6APr2QpQ@mail.gmail.com> <CA+U5nMKOMnBq72vW+_X14cxXpX=Q4K8oJHvnyF12yNt+KrgAGg@mail.gmail.com> <CA+Tgmoa0Dw-D1xV64iab9GvzVgYNzNng9v6pi8g2_B_6HwV38w@mail.gmail.com> <25607.1349984584@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