Re: isolation check takes a long time

Lists: pgsql-hackers
From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: isolation check takes a long time
Date: 2012-07-13 20:05:37
Message-ID: 50007F91.8090508@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Why does the isolation check take such a long time? On some of my slower
buildfarm members I am thinking of disabling it because it takes so
long. This single test typically takes longer than a full serial
standard regression test. Is there any way we could make it faster?

cheers

andrew


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: isolation check takes a long time
Date: 2012-07-13 22:25:26
Message-ID: 1342218222-sup-8473@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Excerpts from Andrew Dunstan's message of vie jul 13 16:05:37 -0400 2012:
> Why does the isolation check take such a long time? On some of my slower
> buildfarm members I am thinking of disabling it because it takes so
> long. This single test typically takes longer than a full serial
> standard regression test. Is there any way we could make it faster?

I think the "prepared transactions" test is the one that takes the
longest. Which is a shame when prepared xacts are not enabled, because
all it does is throw millions of "prepared transactions are not enabled"
errors. There is one other test that takes very long because it commits
a large amount of transactions. I found it to be much faster if run
with fsync disabled.

Maybe it'd be a good idea to disable fsync on buildfarm runs, if we
don't already do so?

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


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: isolation check takes a long time
Date: 2012-07-15 20:42:22
Message-ID: CAD5tBcJ53KaefcFUv6y=7B1oSS=bMFyfej05xNEgR_U9ghwTNA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Jul 13, 2012 at 6:25 PM, Alvaro Herrera
<alvherre(at)commandprompt(dot)com>wrote:

>
> Excerpts from Andrew Dunstan's message of vie jul 13 16:05:37 -0400 2012:
> > Why does the isolation check take such a long time? On some of my slower
> > buildfarm members I am thinking of disabling it because it takes so
> > long. This single test typically takes longer than a full serial
> > standard regression test. Is there any way we could make it faster?
>
> I think the "prepared transactions" test is the one that takes the
> longest. Which is a shame when prepared xacts are not enabled, because
> all it does is throw millions of "prepared transactions are not enabled"
> errors. There is one other test that takes very long because it commits
> a large amount of transactions. I found it to be much faster if run
> with fsync disabled.
>
> Maybe it'd be a good idea to disable fsync on buildfarm runs, if we
> don't already do so?
>

I'm looking into that. But given that the default is to set
max_prepared_transactions to 0, shouldn't we just remove that test from the
normal installcheck schedule?

We could provide an alternative schedule that does include it.

cheers

andrew


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: isolation check takes a long time
Date: 2012-07-17 17:56:19
Message-ID: 1342547503-sup-9993@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Excerpts from Andrew Dunstan's message of dom jul 15 16:42:22 -0400 2012:

> I'm looking into that. But given that the default is to set
> max_prepared_transactions to 0, shouldn't we just remove that test from the
> normal installcheck schedule?
>
> We could provide an alternative schedule that does include it.

That's a thought -- AFAIR we do provide a numeric_big test that's not
exercised by the regular regress schedule, for a precedent.

However, there's more work to do in isolation testing. It'd be good to
have it being routinely run in serializable isolation level, for
example, not just in read committed. I wouldn't want to overload the
slowest machines in the buildfarm (some of which are already barely
capable of running the tests on all branches in a 24h schedule, of which
Stefan Kaltenbrunner is so proud), but if we could have a few of the
fastest members running isolation and isolation-serializable, with
max_prepared_transactions set to a nonzero value, that'd be great.

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


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-17 20:28:32
Message-ID: 20120717202832.GB11508@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Jul 17, 2012 at 01:56:19PM -0400, Alvaro Herrera wrote:
> Excerpts from Andrew Dunstan's message of dom jul 15 16:42:22 -0400 2012:
> > I'm looking into that. But given that the default is to set
> > max_prepared_transactions to 0, shouldn't we just remove that test from the
> > normal installcheck schedule?

> That's a thought -- AFAIR we do provide a numeric_big test that's not
> exercised by the regular regress schedule, for a precedent.

It would be nice to have a pattern for adding tests run less often than "every
commit" but more often than "whenever a human explicitly remembers the test
and invokes it manually". Perhaps a schedule that the recommended buildfarm
configuration would somehow run every two weeks and before each release
(including betas and branch releases).

> However, there's more work to do in isolation testing. It'd be good to
> have it being routinely run in serializable isolation level, for
> example, not just in read committed.

Except for the foreign key specs, isolation test specs request a specific
isolation level when starting their transactions. Running such specs under
different default_transaction_isolation settings primarily confirms that
"BEGIN TRANSACTION ISOLATION LEVEL x" is indistinguishable from "BEGIN" under
default_transaction_isolation = x. It might also discover transaction
isolation sensitivity in the setup/cleanup steps, which often omit explicit
transaction control. I don't think such verification justifies regularly
running thousands of tests. The foreign key tests, however, would benefit
from running under all three isolation levels. Let's control it per-spec
instead of repeating the entire suite.


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: isolation check takes a long time
Date: 2012-07-19 13:54:09
Message-ID: 50081181.5050700@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 07/17/2012 04:28 PM, Noah Misch wrote:
> On Tue, Jul 17, 2012 at 01:56:19PM -0400, Alvaro Herrera wrote:
>> Excerpts from Andrew Dunstan's message of dom jul 15 16:42:22 -0400 2012:
>>> I'm looking into that. But given that the default is to set
>>> max_prepared_transactions to 0, shouldn't we just remove that test from the
>>> normal installcheck schedule?
>> That's a thought -- AFAIR we do provide a numeric_big test that's not
>> exercised by the regular regress schedule, for a precedent.
> It would be nice to have a pattern for adding tests run less often than "every
> commit" but more often than "whenever a human explicitly remembers the test
> and invokes it manually". Perhaps a schedule that the recommended buildfarm
> configuration would somehow run every two weeks and before each release
> (including betas and branch releases).

We have some support for that sort of thing. The optional_steps feature
can run with a minimum number of hours between runs. Currently the only
supported such steps are build_docs and find_typedefs. If there are
extra tests we'd want run in that fashion then they would need code
added for them.

Meanwhile, I would like to remove the prepared_transactions test from
the main isolation schedule, and add a new Make target which runs that
test explicitly. Is there any objection to that?

cheers

andrew


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: isolation check takes a long time
Date: 2012-07-20 17:15:12
Message-ID: 50099220.2060005@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 07/19/2012 09:54 AM, Andrew Dunstan wrote:
>
>
>
> Meanwhile, I would like to remove the prepared_transactions test from
> the main isolation schedule, and add a new Make target which runs that
> test explicitly. Is there any objection to that?
>
>

Here's the patch for that.

cheers

andrew

Attachment Content-Type Size
isolation-test.patch text/x-patch 1.9 KB

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Noah Misch <noah(at)leadboat(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: isolation check takes a long time
Date: 2012-07-20 17:37:28
Message-ID: 1342805761-sup-2721@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Excerpts from Andrew Dunstan's message of vie jul 20 13:15:12 -0400 2012:
>
> On 07/19/2012 09:54 AM, Andrew Dunstan wrote:
> >
> >
> >
> > Meanwhile, I would like to remove the prepared_transactions test from
> > the main isolation schedule, and add a new Make target which runs that
> > test explicitly. Is there any objection to that?
> >
> >
>
>
> Here's the patch for that.

Looks reasonable. I'd like to have an "include" directive in regress
files so that we don't have to repeat the whole set in the second file,
but please don't let that wishlist item to stop you from committing this
patch.

Are you planning to have one of your animals run the prepared xacts
schedule? :-)

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


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-20 17:39:34
Message-ID: 1342805856-sup-2746@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Excerpts from Noah Misch's message of mar jul 17 16:28:32 -0400 2012:
>
> On Tue, Jul 17, 2012 at 01:56:19PM -0400, Alvaro Herrera wrote:

> > However, there's more work to do in isolation testing. It'd be good to
> > have it being routinely run in serializable isolation level, for
> > example, not just in read committed.
>
> Except for the foreign key specs, isolation test specs request a specific
> isolation level when starting their transactions. Running such specs under
> different default_transaction_isolation settings primarily confirms that
> "BEGIN TRANSACTION ISOLATION LEVEL x" is indistinguishable from "BEGIN" under
> default_transaction_isolation = x. It might also discover transaction
> isolation sensitivity in the setup/cleanup steps, which often omit explicit
> transaction control. I don't think such verification justifies regularly
> running thousands of tests. The foreign key tests, however, would benefit
> from running under all three isolation levels. Let's control it per-spec
> instead of repeating the entire suite.

Understood and agreed. Maybe we could use a new directive in the spec
file format for this.

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


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Noah Misch <noah(at)leadboat(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: isolation check takes a long time
Date: 2012-07-20 17:51:29
Message-ID: 50099AA1.5020705@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 07/20/2012 01:37 PM, Alvaro Herrera wrote:
> Excerpts from Andrew Dunstan's message of vie jul 20 13:15:12 -0400 2012:
>> On 07/19/2012 09:54 AM, Andrew Dunstan wrote:
>>>
>>>
>>> Meanwhile, I would like to remove the prepared_transactions test from
>>> the main isolation schedule, and add a new Make target which runs that
>>> test explicitly. Is there any objection to that?
>>>
>>>
>>
>> Here's the patch for that.
> Looks reasonable. I'd like to have an "include" directive in regress
> files so that we don't have to repeat the whole set in the second file,
> but please don't let that wishlist item to stop you from committing this
> patch.
>
> Are you planning to have one of your animals run the prepared xacts
> schedule? :-)
>

Possibly - I'm tossing up in my mind the best way to do that. (Hacking
the script on a particular client would be the wrong way.)

cheers

andrew


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Noah Misch <noah(at)leadboat(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: isolation check takes a long time
Date: 2012-07-20 17:56:47
Message-ID: 27378.1342807007@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> Excerpts from Andrew Dunstan's message of vie jul 20 13:15:12 -0400 2012:
>>> Meanwhile, I would like to remove the prepared_transactions test from
>>> the main isolation schedule, and add a new Make target which runs that
>>> test explicitly. Is there any objection to that?

> Looks reasonable. I'd like to have an "include" directive in regress
> files so that we don't have to repeat the whole set in the second file,
> but please don't let that wishlist item to stop you from committing this
> patch.

I'm not thrilled with replicating the test-list file either. But it is
not necessary: look at the way the "bigtest" target is defined in the
main regression makefile. You can just add some more test names on the
command line, to be done in addition to what's in the schedule file.
I think we should do it that way here too.

regards, tom lane


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Noah Misch <noah(at)leadboat(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: isolation check takes a long time
Date: 2012-07-20 19:16:45
Message-ID: 5009AE9D.7080801@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 07/20/2012 01:56 PM, Tom Lane wrote:
> I'm not thrilled with replicating the test-list file either. But it is
> not necessary: look at the way the "bigtest" target is defined in the
> main regression makefile. You can just add some more test names on the
> command line, to be done in addition to what's in the schedule file.
> I think we should do it that way here too.
>
>

Oh, I wasn't aware of that. Will do.

cheers

andrew


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-22 21:11:53
Message-ID: 20120722211153.GA7500@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Jul 20, 2012 at 01:39:34PM -0400, Alvaro Herrera wrote:
> Excerpts from Noah Misch's message of mar jul 17 16:28:32 -0400 2012:
> > The foreign key tests, however, would benefit
> > from running under all three isolation levels. Let's control it per-spec
> > instead of repeating the entire suite.
>
> Understood and agreed. Maybe we could use a new directive in the spec
> file format for this.

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.

Thoughts?


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Noah Misch <noah(at)leadboat(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: isolation check takes a long time
Date: 2012-07-24 05:14:24
Message-ID: 1343106864.21442.0.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On fre, 2012-07-20 at 13:15 -0400, Andrew Dunstan wrote:
> On 07/19/2012 09:54 AM, Andrew Dunstan wrote:
> >
> >
> >
> > Meanwhile, I would like to remove the prepared_transactions test from
> > the main isolation schedule, and add a new Make target which runs that
> > test explicitly. Is there any objection to that?
> >
> >
>
>
> Here's the patch for that.

Why was this backpatched to 9.1? That doesn't seem appropriate.


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Noah Misch <noah(at)leadboat(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: isolation check takes a long time
Date: 2012-07-24 06:02:19
Message-ID: 14553.1343109739@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> On fre, 2012-07-20 at 13:15 -0400, Andrew Dunstan wrote:
>>> Meanwhile, I would like to remove the prepared_transactions test from
>>> the main isolation schedule, and add a new Make target which runs that
>>> test explicitly. Is there any objection to that?

> Why was this backpatched to 9.1? That doesn't seem appropriate.

AIUI the point was to cut the load on buildfarm machines, so it won't
help (as much) if it's only applied to a subset of the branches that
have this test. In any case, I don't follow your objection. Removing
regression tests from stable branches is probably safer than removing
them from HEAD.

regards, tom lane


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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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


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
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" }


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-26 16:16:29
Message-ID: 1343319223-sup-3201@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Excerpts from Noah Misch's message of jue jul 26 06:28:54 -0400 2012:
>
> On Tue, Jul 24, 2012 at 11:08:09AM -0400, Alvaro Herrera wrote:

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

Okay, great.

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

Understood.

> 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" }

Agreed. What would be the syntax to specify a particular value to use
in a permutation? Maybe

permutation isolation=rr "step1" "step2" ...

I'm not sure about requiring quotes around those identifiers.

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


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-27 00:12:48
Message-ID: 20120727001248.GA31830@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Jul 26, 2012 at 12:16:29PM -0400, Alvaro Herrera wrote:
> Excerpts from Noah Misch's message of jue jul 26 06:28:54 -0400 2012:
> > var "isolation" = { "rc" => "READ COMMITTED", "rr" => "REPEATABLE READ" }
>
> Agreed. What would be the syntax to specify a particular value to use
> in a permutation? Maybe
>
> permutation isolation=rr "step1" "step2" ...

I figured just 'permutation "rr" "step1" "step2"', in keeping with the
tendency toward terseness already found in the implementation. It would then
be an error to use a name more than once among specs and variable.

> I'm not sure about requiring quotes around those identifiers.

Let's keep it consistent with the requirement in other contexts of the spec
file. I generally favor a policy of optional quotes, but that could be its
own patch.

Thanks,
nm