Re: isolation check takes a long time - Mailing list pgsql-hackers

From Noah Misch
Subject Re: isolation check takes a long time
Date
Msg-id 20120726102854.GB25195@tornado.leadboat.com
Whole thread Raw
In response to Re: isolation check takes a long time  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: isolation check takes a long time  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
On Tue, Jul 24, 2012 at 11:08:09AM -0400, Alvaro Herrera wrote:
> Excerpts from Noah Misch's message of dom jul 22 17:11:53 -0400 2012:
> >     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"

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

> 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.

Yes; I intended the same.

> With that in mind, having each possible value
> for a setting be declared independently might be a bit troublesome.

I wouldn't expect any of these syntax variants to substantially simplify or
complicate the code for generating all possible permutations.  We can choose
based on convenience and flexibility for spec authors.

> 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?

Between those two, I prefer the second -- having two names for each variable
does not add much.  However, both lose some flexibility by not giving a name
to each possible value.  'permutation "isolation" "foo"' actually requests two
runs through the test case, one with each variable value.  There would be no
way to specify permutations to run with fewer than the full range of values.
I lean toward preserving that flexibility.  That being said, perhaps a
one-statement syntax remains nicer?
var "isolation" = { "rc" => "READ COMMITTED", "rr" => "REPEATABLE READ" }


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Re: [BUGS] BUG #6733: All Tables Empty After pg_upgrade (PG 9.2.0 beta 2)
Next
From: Bruce Momjian
Date:
Subject: Re: Using pg_upgrade on log-shipping standby servers