Re: serializable read only deferrable

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <drkp(at)csail(dot)mit(dot)edu>,<pgsql-hackers(at)postgresql(dot)org>
Subject: Re: serializable read only deferrable
Date: 2010-12-08 20:01:10
Message-ID: 4CFF8FA60200002500038486@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> If the standard says that you're allowed to apply a redundant
> setting, I think we'd better accept that.

OK

> So the implementation I had in mind would allow SET TRANSACTION
> operations to occur later in a subxact, as long as they were
> redundant and weren't actually trying to change the active value.

It's easy to see how I can allow changes in the subtransaction as
long as they don't specify READ WRITE when the top level is READ
ONLY, but it isn't obvious to me how to only allow it at the start
of the subtransaction. I'm OK with taking the easy route on this
aspect of things, but if someone needs READ ONLY to "stick" for the
duration of a subtransaction, I'm not sure how to do that. (And I'm
not sure you were actually suggesting that, either.)

To restate, since I'm not sure how clear that is, what I have at the
moment is:

(1) A top level transaction can only set READ ONLY or READ WRITE
until it has acquired its first snapshot.

(2) A subtransaction can set it at will, as many times as desired,
to match the top level or specify READ ONLY.

(3) During recovery the setting cannot be changed from READ ONLY to
READ WRITE.

I'm not clear whether #2 is OK or how to do it only at the start.
I haven't yet looked at the other issues you mentioned.

-Kevin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Florian Pflug 2010-12-08 20:02:41 Re: serializable read only deferrable
Previous Message Tom Lane 2010-12-08 19:46:25 Re: serializable read only deferrable