Skip to content

Commit 103512c

Browse files
committed
Attempt to fix broken regression test.
In commit 8c1d9d5, I attempted to add a regression test that would fail if the target list was pushed into a parallel worker, but due to brain fade on my part, it just randomly fails whether anything bad or not, because the error check inside the parallel_restricted() function tests whether there is *any process in the system* that is not connected to a client, not whether the process running the query is not connected to a client. A little experimentation has left me pessimistic about the prospects of doing better here in a short amount of time, so let's just fall back to checking that the plan is as we expect and leave the execution-time check for another day.
1 parent 4c56f32 commit 103512c

File tree

2 files changed

+4
-39
lines changed

2 files changed

+4
-39
lines changed

src/test/regress/expected/select_parallel.out

+2-29
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
--
22
-- PARALLEL
33
--
4-
create or replace function parallel_restricted(int) returns int as $$
5-
begin
6-
perform * from pg_stat_activity where client_port is null;
7-
if (found) then
8-
raise 'parallel restricted function run in worker';
9-
end if;
10-
return $1;
11-
end$$ language plpgsql parallel restricted;
4+
create or replace function parallel_restricted(int) returns int as
5+
$$begin return $1; end$$ language plpgsql parallel restricted;
126
-- Serializable isolation would disable parallel query, so explicitly use an
137
-- arbitrary other level.
148
begin isolation level repeatable read;
@@ -57,27 +51,6 @@ select parallel_restricted(unique1) from tenk1
5751
Filter: (tenk1.stringu1 = 'GRAAAA'::name)
5852
(9 rows)
5953

60-
select parallel_restricted(unique1) from tenk1
61-
where stringu1 = 'GRAAAA' order by 1;
62-
parallel_restricted
63-
---------------------
64-
448
65-
1124
66-
1800
67-
2476
68-
3152
69-
3828
70-
4504
71-
5180
72-
5856
73-
6532
74-
7208
75-
7884
76-
8560
77-
9236
78-
9912
79-
(15 rows)
80-
8154
set force_parallel_mode=1;
8255
explain (costs off)
8356
select stringu1::int2 from tenk1 where unique1 = 1;

src/test/regress/sql/select_parallel.sql

+2-10
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,8 @@
22
-- PARALLEL
33
--
44

5-
create or replace function parallel_restricted(int) returns int as $$
6-
begin
7-
perform * from pg_stat_activity where client_port is null;
8-
if (found) then
9-
raise 'parallel restricted function run in worker';
10-
end if;
11-
return $1;
12-
end$$ language plpgsql parallel restricted;
5+
create or replace function parallel_restricted(int) returns int as
6+
$$begin return $1; end$$ language plpgsql parallel restricted;
137

148
-- Serializable isolation would disable parallel query, so explicitly use an
159
-- arbitrary other level.
@@ -29,8 +23,6 @@ alter table tenk1 set (parallel_workers = 4);
2923
explain (verbose, costs off)
3024
select parallel_restricted(unique1) from tenk1
3125
where stringu1 = 'GRAAAA' order by 1;
32-
select parallel_restricted(unique1) from tenk1
33-
where stringu1 = 'GRAAAA' order by 1;
3426

3527
set force_parallel_mode=1;
3628

0 commit comments

Comments
 (0)