Thread: pgsql: Add regression test for 04ae11f62e643e07c411c4935ea6af46cb112aa9

pgsql: Add regression test for 04ae11f62e643e07c411c4935ea6af46cb112aa9

From
Robert Haas
Date:
Add regression test for 04ae11f62e643e07c411c4935ea6af46cb112aa9.

The code in this area needs further revision, and it would be best
not to re-break the things we've already fixed.

Per a gripe from Tom Lane.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/8c1d9d56e9a00680a035b8b333a98ea16b121eb7

Modified Files
--------------
src/test/regress/expected/select_parallel.out | 48 +++++++++++++++++++++++++++
src/test/regress/sql/select_parallel.sql      | 18 ++++++++++
2 files changed, 66 insertions(+)


Robert Haas <rhaas@postgresql.org> writes:
> Add regression test for 04ae11f62e643e07c411c4935ea6af46cb112aa9.

BTW, the buildfarm thinks this test fails a lot of the time, and
running "make installcheck-parallel" a few times here agrees: it
falls over more than 20% of the time.  Don't know why it would be
probabilistic, but the alleged protection against running
parallel-restricted functions in workers apparently doesn't work
at all.

            regards, tom lane


On Fri, Jun 17, 2016 at 9:20 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Robert Haas <rhaas@postgresql.org> writes:
> > Add regression test for 04ae11f62e643e07c411c4935ea6af46cb112aa9.
>
> BTW, the buildfarm thinks this test fails a lot of the time, and
> running "make installcheck-parallel" a few times here agrees: it
> falls over more than 20% of the time.  Don't know why it would be
> probabilistic,
>

I also got failure with this test on my m/c:
select parallel_restricted(unique1) from tenk1
  where stringu1 = 'GRAAAA' order by 1;
ERROR:  parallel restricted function run in worker
CONTEXT:  PL/pgSQL function parallel_restricted(integer) line 5 at RAISE


Isn't it possible that the below statement used in parallel restricted function fails in leader backend itself:
+  perform * from pg_stat_activity where client_port is null;
+  if (found) then
+    raise 'parallel restricted function run in worker';
+  end if;


With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com
On Fri, Jun 17, 2016 at 12:55 AM, Amit Kapila <amit.kapila16@gmail.com> wrote:
> Isn't it possible that the below statement used in parallel restricted
> function fails in leader backend itself:
> +  perform * from pg_stat_activity where client_port is null;
> +  if (found) then
> +    raise 'parallel restricted function run in worker';
> +  end if;

Yeah, I can't believe I managed to be dumb enough to think that was
going to work.

Clearly, I shouldn't be trusted with anything more dangerous than a
dull pair of scissors.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: pgsql: Add regression test for 04ae11f62e643e07c411c4935ea6af46cb112aa9

From
Andres Freund
Date:
On 2016-06-17 08:41:31 -0400, Robert Haas wrote:
> On Fri, Jun 17, 2016 at 12:55 AM, Amit Kapila <amit.kapila16@gmail.com> wrote:
> > Isn't it possible that the below statement used in parallel restricted
> > function fails in leader backend itself:
> > +  perform * from pg_stat_activity where client_port is null;
> > +  if (found) then
> > +    raise 'parallel restricted function run in worker';
> > +  end if;
>
> Yeah, I can't believe I managed to be dumb enough to think that was
> going to work.
>
> Clearly, I shouldn't be trusted with anything more dangerous than a
> dull pair of scissors.

Dull scissors actually cause much harder to sow up / heal wounds, than
sharp ones ... :P