From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Jim Nasby <jim(at)nasby(dot)net>, Jeff Davis <pgsql(at)j-davis(dot)com>, Joachim Wieland <joe(at)mcknight(dot)de>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: synchronized snapshots |
Date: | 2011-08-17 01:08:48 |
Message-ID: | CA+TgmoadA+NrTuM91aReHNny3T=QFQSp-de6cETN9FXosddLCQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Tue, Aug 16, 2011 at 8:53 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Tue, Aug 16, 2011 at 8:35 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> I think we'd be far better off to maintain the position that a failed
>>> BEGIN does not start a transaction, under any circumstances.
>
>> Also agreed.
>
>>> To do
>>> that, we cannot have this new option attached to the BEGIN, ...
>
>> Eh, why not?
>
> Maybe I wasn't paying close enough attention to the thread, but I had
> the idea that there was some implementation reason why not. If not,
> we could still load the option onto BEGIN ... but I still find myself
> liking the idea of a separate command better, because of the locking
> issue.
Why does it matter whether you take the locks before or after the snapshot?
If you're concerned with minimizing the race, what you should do is
take all relevant locks in the parent before exporting the snapshot.
I am not wild about adding another toplevel command for this. It
seems a rather narrow use case, and attaching it to BEGIN feels
natural to me. There may be some small benefit also in terms of
minimizing the amount of sanity checking that must be done - for
example, at BEGIN time, you don't have to check for the case where a
snapshot has already been set.
If we did add another toplevel command, what would we call it?
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2011-08-17 01:10:20 | Re: Finding tables dropped by DROP TABLE CASCADE |
Previous Message | Tom Lane | 2011-08-17 00:53:34 | Re: synchronized snapshots |