Thread: SSI, simplified

SSI, simplified

From
"Kevin Grittner"
Date:
Dan is still beating up on the latest patch with DBT-2, but I expect
that I'll be posting a patch tomorrow with all known issues fixed, no
known bugs, and reasonable performance -- except for the issue of how
this work relates to hot standby in the 9.1 release.  (We did find
and fix a few bugs after V13, although most of our changes have been
tweaking comments, and the bug fixes have mostly consisted of moving
LW lock statements up or down a few lines.)
If I get a solid answer on the SSI/HS issue before I post V14, I
might be able to cover that, too, in that patch.  I haven't wanted to
totally write off the possibility of integrating them as long as
discussion was ongoing; but if someone wants to assume the voice of
Dr. McCoy and declare "It's dead, Jim," I can move on for now and
come back to the issue for 9.2.
In the mean time, I've been pondering the fact that many of those
posting on SSI issues apparently haven't read even the Overview
section of the Wiki page.
http://wiki.postgresql.org/wiki/Serializable
I know how busy people are, so (inspired by the both the Geico
commercial which they boast was put together on the xtranormal sight
in 15 minutes or less, and the old favorite book "Einstein
Simplified") I've put together an animated "movie" which punches a
few key points from the overview in less than three minutes.
Hopefully, what it lacks in detail it makes up for with brevity and
humor.
Oddly, the computer generated voice sorta mangled something near the
beginning, which was supposed to be "I'm psyched", but sorta sounds
like "I'm sorry".  Computers -- you just can't rely on 'em.  I hope
people find it entertaining and at least slightly informative.  :-)
http://www.xtranormal.com/watch/8285377/?listid=20642536
I could have just kept on going, but I decided at the start that it
had to be less than three minutes.  Also, please make allowances for
the fact that while I went over 15 minutes putting that "movie"
together, it wasn't by all that much....
-Kevin


Re: SSI, simplified

From
Heikki Linnakangas
Date:
On 24.01.2011 03:48, Kevin Grittner wrote:
> If I get a solid answer on the SSI/HS issue before I post V14, I
> might be able to cover that, too, in that patch.  I haven't wanted to
> totally write off the possibility of integrating them as long as
> discussion was ongoing; but if someone wants to assume the voice of
> Dr. McCoy and declare "It's dead, Jim," I can move on for now and
> come back to the issue for 9.2.

It's dead, Jim.

Even if it wasn't, it'd still make sense to leave it out of the first 
commit, and add as later patch. So in any case, the first commit should 
just throw an error.

> Oddly, the computer generated voice sorta mangled something near the
> beginning, which was supposed to be "I'm psyched", but sorta sounds
> like "I'm sorry".  Computers -- you just can't rely on 'em.  I hope
> people find it entertaining and at least slightly informative.  :-)
>
> http://www.xtranormal.com/watch/8285377/?listid=20642536

Wow, that's hilarious! :-)

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


Re: SSI, simplified

From
Joshua Tolley
Date:
On Sun, Jan 23, 2011 at 07:48:04PM -0600, Kevin Grittner wrote:
> http://www.xtranormal.com/watch/8285377/?listid=20642536

I foresee a whole new set of animated postgres tutorials...

--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com

Re: SSI, simplified

From
"Kevin Grittner"
Date:
Joshua Tolley <eggyknap@gmail.com> wrote:
>> http://www.xtranormal.com/watch/8285377/?listid=20642536 
> I foresee a whole new set of animated postgres tutorials...
Seriously, I was thinking the same thing.  I threw this together
while waiting to see if DBT-2 could shake out any new problems after
some minor changes to the SSI patch.  It was my first time playing
with the site and it took about an hour and a half, and didn't quite
use up all the free credits you get with the trial.  With some
actual *planning* someone with some experience could put together
some nice training clips, I would think.
-Kevin


Re: SSI, simplified

From
Simon Riggs
Date:
On Mon, 2011-01-24 at 09:29 +0200, Heikki Linnakangas wrote:
> On 24.01.2011 03:48, Kevin Grittner wrote:
> > If I get a solid answer on the SSI/HS issue before I post V14, I
> > might be able to cover that, too, in that patch.  I haven't wanted to
> > totally write off the possibility of integrating them as long as
> > discussion was ongoing; but if someone wants to assume the voice of
> > Dr. McCoy and declare "It's dead, Jim," I can move on for now and
> > come back to the issue for 9.2.
> 
> It's dead, Jim.

Agreed, for 9.1

> Even if it wasn't, it'd still make sense to leave it out of the first 
> commit, and add as later patch. So in any case, the first commit should 
> just throw an error.

Not sure how to handle that. My understanding is that we are replacing
the old Serializable mode with the new Serializable mode. The old way
works, but the new way doesn't. I don't think we should throw an error;
we just need to document that it works the old way on HS and the new way
everywhere else. Maybe that's inconsistent, but throwing errors isn't
useful in places where there didn't used to be any.

-- Simon Riggs           http://www.2ndQuadrant.com/books/PostgreSQL Development, 24x7 Support, Training and Services



Re: SSI, simplified

From
Dimitri Fontaine
Date:
Simon Riggs <simon@2ndQuadrant.com> writes:
> Not sure how to handle that. My understanding is that we are replacing
> the old Serializable mode with the new Serializable mode. The old way
> works, but the new way doesn't. I don't think we should throw an error;
> we just need to document that it works the old way on HS and the new way
> everywhere else. Maybe that's inconsistent, but throwing errors isn't
> useful in places where there didn't used to be any.

Well if you want the old behaviour you can ask for REPEATABLE READ and
have it.  Granted, that means you have to edit the application code that
talks to the Hot Standby, but surely you want to edit the same code when
it talks to the master to ask the proper level of serialisation, which
just changed underneath you?

Regards,
-- 
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


Re: SSI, simplified

From
Simon Riggs
Date:
On Wed, 2011-01-26 at 14:27 +0100, Dimitri Fontaine wrote:
> Simon Riggs <simon@2ndQuadrant.com> writes:
> > Not sure how to handle that. My understanding is that we are replacing
> > the old Serializable mode with the new Serializable mode. The old way
> > works, but the new way doesn't. I don't think we should throw an error;
> > we just need to document that it works the old way on HS and the new way
> > everywhere else. Maybe that's inconsistent, but throwing errors isn't
> > useful in places where there didn't used to be any.
> 
> Well if you want the old behaviour you can ask for REPEATABLE READ and
> have it.  Granted, that means you have to edit the application code that
> talks to the Hot Standby, but surely you want to edit the same code when
> it talks to the master to ask the proper level of serialisation, which
> just changed underneath you?

OK, thanks for explaining. Yes, that sounds OK.

So in the Compatibility release notes for 9.1 we should say:

"Applications that request SERIALIZABLE mode will now experience
different and fully correct behaviour. The new mode does not currently
work in Hot Standby mode, and an error will be returned if this is
requested. If the previous serializable behaviour is required, users
should request transaction isolation mode REPEATABLE READ."

-- Simon Riggs           http://www.2ndQuadrant.com/books/PostgreSQL Development, 24x7 Support, Training and Services



Re: SSI, simplified

From
"Kevin Grittner"
Date:
Simon Riggs <simon@2ndQuadrant.com> wrote:
> So in the Compatibility release notes for 9.1 we should say:
> 
> "Applications that request SERIALIZABLE mode will now experience
> different and fully correct behaviour. The new mode does not
> currently work in Hot Standby mode, and an error will be returned
> if this is requested. If the previous serializable behaviour is
> required, users should request transaction isolation mode
> REPEATABLE READ."
Yeah, we definitely need to mention it in the release notes.  I feel
there should also be notes in the regular docs, but Heikki would
(quite understandably) prefer to minimize changes to the current
patch until it is committed and deal with that such issues in
smaller follow-up patches.
-Kevin


Re: SSI, simplified

From
Alvaro Herrera
Date:
Excerpts from Simon Riggs's message of mié ene 26 10:40:28 -0300 2011:

> So in the Compatibility release notes for 9.1 we should say:
> 
> "Applications that request SERIALIZABLE mode will now experience
> different and fully correct behaviour. The new mode does not currently
> work in Hot Standby mode, and an error will be returned if this is
> requested. If the previous serializable behaviour is required, users
> should request transaction isolation mode REPEATABLE READ."

Also, perhaps
errmsg("cannot use serializable mode in a hot standby"),errhint("You can use REPEATABLE READ instead.")

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


Re: SSI, simplified

From
"Kevin Grittner"
Date:
Alvaro Herrera <alvherre@commandprompt.com> wrote:
> Also, perhaps
> 
>  errmsg("cannot use serializable mode in a hot standby"),
>  errhint("You can use REPEATABLE READ instead.")
OK:
http://git.postgresql.org/gitweb?p=users/kgrittn/postgres.git;a=commitdiff;h=0950b11c91aecbbe490ec06205235d60fcd90a2e
-Kevin


Re: SSI, simplified

From
Heikki Linnakangas
Date:
On 26.01.2011 17:00, Kevin Grittner wrote:
> Simon Riggs<simon@2ndQuadrant.com>  wrote:
>
>> So in the Compatibility release notes for 9.1 we should say:
>>
>> "Applications that request SERIALIZABLE mode will now experience
>> different and fully correct behaviour. The new mode does not
>> currently work in Hot Standby mode, and an error will be returned
>> if this is requested. If the previous serializable behaviour is
>> required, users should request transaction isolation mode
>> REPEATABLE READ."
>
> Yeah, we definitely need to mention it in the release notes.  I feel
> there should also be notes in the regular docs, but Heikki would
> (quite understandably) prefer to minimize changes to the current
> patch until it is committed and deal with that such issues in
> smaller follow-up patches.

By all means, feel free to add a note to the docs about this. A note in 
the Hot Standby Caveats section would be good, in addition to somewhere 
in the chapter about isolation levels.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


Re: SSI, simplified

From
"Kevin Grittner"
Date:
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> wrote:
> By all means, feel free to add a note to the docs about this. A
> note in the Hot Standby Caveats section would be good, in addition
> to somewhere in the chapter about isolation levels.
OK, will do.
-Kevin


Re: SSI, simplified

From
"Kevin Grittner"
Date:
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> wrote:
> By all means, feel free to add a note to the docs about this. A
> note in the Hot Standby Caveats section would be good, in addition
> to somewhere in the chapter about isolation levels.
Here's what I came up with:
http://git.postgresql.org/gitweb?p=users/kgrittn/postgres.git;a=commitdiff;h=54e9ebcc8271c7ef47941cf29bcdd53221076fed
Do any other spots need something?  Suggested changes?
So far we have one bug fix and a few doc, README, and comment
changes.  It's all available on git.  Does anyone want to see a new
patch?
-Kevin


Re: SSI, simplified

From
"Kevin Grittner"
Date:
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> wrote:
> Suggested changes?
I see that Heikki suggested that the change to the hot standby docs
belonged in the Caveats section.  Will change that note to a bullet
point under Caveats.
Sorry I didn't catch that sooner.
-Kevin