Skip site navigation (1) Skip section navigation (2)

Re: isolation check takes a long time

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: isolation check takes a long time
Date: 2012-07-24 15:08:09
Message-ID: 1343141823-sup-5659@alvh.no-ip.org (view raw or flat)
Thread:
Lists: pgsql-hackers
Excerpts from Noah Misch's message of dom jul 22 17:11:53 -0400 2012:

> I was pondering something like this:
> 
>     setting "i-rc" "isolation" = "READ COMMITTED"
>     setting "i-rr" "isolation" = "REPEATABLE READ"
> 
>     session "s1"
>     setup        { BEGIN TRANSACTION ISOLATION LEVEL :isolation; }
>     step "foo"    { SELECT 1; }
> 
>     permutation "i-rc" "foo"
>     permutation "i-rr" "foo"
> 
> That is, introduce psql-style variable substitutions in per-session "setup",
> "step" and "teardown" directives.  Introduce the "setting" directive to
> declare possible values for each variable.  Each permutation may name settings
> as well as steps.  Order within the permutation would not matter; we could
> allow them anywhere in the list or only at the beginning.  When the tester
> generates permutations, it would include all variable setting combinations.

The idea of using psql-style variables seems good to me.

Offhand having the setting names appear in permutations just like step
names seems a bit weird to me, though I admit that I don't see any other
way that's not overly verbose.

I would expect that if no permutations are specified, all possible
values for a certain setting would be generated.  That way it'd be easy
to define tests that run through all possible permutations of two (or
more) sequences of commands on all isolation levels, without having the
specify them all by hand.  With that in mind, having each possible value
for a setting be declared independently might be a bit troublesome.

Something like 

     setting "isolevel" "isolation" = { "READ COMMITTED", "REPEATABLE READ" }
 
     session "s1"
     setup        { BEGIN TRANSACTION ISOLATION LEVEL :isolation; }
     step "foo"    { SELECT 1; }
 
     permutation "isolevel" "foo"

Maybe we can have a single name for both the setting specification and
variable name, instead of having to invent two names; in that case, it'd
reduce to

     setting "isolation" = { "READ COMMITTED", "REPEATABLE READ" }
 
     session "s1"
     setup        { BEGIN TRANSACTION ISOLATION LEVEL :isolation; }
     step "foo"    { SELECT 1; }
 
     permutation "isolation" "foo"

Thoughts?

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

In response to

Responses

pgsql-hackers by date

Next:From: Merlin MoncureDate: 2012-07-24 15:18:41
Subject: Re: [patch] libpq one-row-at-a-time API
Previous:From: Greg StarkDate: 2012-07-24 13:33:26
Subject: Re: Checkpointer split has broken things dramatically (was Re: DELETE vs TRUNCATE explanation)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group