Re: synchronized snapshots

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Florian Pflug <fgp(at)phlo(dot)org>, Joachim Wieland <joe(at)mcknight(dot)de>, Marko Tiikkaja <marko(dot)tiikkaja(at)2ndquadrant(dot)com>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: synchronized snapshots
Date: 2011-10-19 17:10:02
Message-ID: CA+TgmoYNjMhoVJSVN-yciXy8Ga2Y2sgW4OVZ06QieXGSioZdcg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 19, 2011 at 1:02 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Florian Pflug <fgp(at)phlo(dot)org> writes:
>> On Oct19, 2011, at 18:17 , Tom Lane wrote:
>>> AFAICS we should just throw an error if SET TRANSACTION SNAPSHOT is done
>>> in a transaction with those properties.  Has anyone got another
>>> interpretation?  Would it be better to silently ignore the DEFERRABLE
>>> property?
>
>> Hm, both features are meant to be used by pg_dump, so think we should
>> make the combination work. It'd say SET TRANSACTION SNAPSHOT should throw
>> an error only if the transaction is marked READ ONLY DEFERRABLE *and*
>> the provided snapshot isn't "safe".
>
> Um, no, I don't think so.  It would be sensible for the "leader"
> transaction to use READ ONLY DEFERRABLE and then export the snapshot it
> got (possibly after waiting).  It doesn't follow that the child
> transactions should use DEFERRABLE too.  They're not going to wait.
>
>> This allows a deferrable snapshot to be used on a second connection (
>> by e.g. pg_dump), and still be marked as DEFERRABLE. If we throw an
>> error unconditionally, the second connection has to import the snapshot
>> without marking it DEFERRABLE, which I think has consequences for
>> performance.
>
> No, I don't believe that either.  AIUI the performance benefit comes if
> the snapshot is recognized as safe.  DEFERRABLE only means to keep
> retrying until you get a safe one.  This is nonsense when you're
> importing the snapshot.

I think the requirement is that we need to do the appropriate push-ups
so that the people who import the snapshot know that it's safe, and
that the SSI stuff can all be skipped.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2011-10-19 17:10:33 Re: (patch) regression diffs on collate.linux.utf8 test
Previous Message Robert Haas 2011-10-19 17:08:13 Re: [PATCH] Deferrable unique constraints vs join removal -- bug?