Re: isolation check takes a long time

From: Noah Misch <noah(at)leadboat(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(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-26 10:28:54
Message-ID: 20120726102854.GB25195@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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" }

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2012-07-26 12:30:40 Re: Using pg_upgrade on log-shipping standby servers
Previous Message Bruce Momjian 2012-07-26 10:22:19 Re: Re: [BUGS] BUG #6733: All Tables Empty After pg_upgrade (PG 9.2.0 beta 2)