greenplum-db/plcontainer

Runtime error when query in plpy.execute retuns less then 6 rows.

Ngoroth opened this issue · 1 comments

Error:
[XX000] ERROR: plcontainer: Error receiving data from the client. Maybe retry later. (plcontainer.c:362)

Step to reproduce:

create table if not exists edges (source text, target text) distributed randomly;
insert into edges values('a', 'b'); insert into edges values('a', 'b');
insert into edges values('b', 'c'); insert into edges values('b', 'd');
insert into edges values('b', 'e'); insert into edges values('e', 'c');
insert into edges values('c', 'd'); insert into edges values('d', 'a');
insert into edges values('a', 'b'); insert into edges values('a', 'b');
insert into edges values('b', 'c'); insert into edges values('b', 'd');
insert into edges values('b', 'e'); insert into edges values('e', 'c');
insert into edges values('c', 'd'); insert into edges values('d', 'a');
CREATE OR REPLACE FUNCTION functions.pl_1(edges_query text) 
  RETURNS text 
  LANGUAGE plcontainer
AS $function$
# container: plc_python_shared   
d = plpy.execute(edges_query)
return '["ok"]'
$function$;
SELECT * functions.pl_1('SELECT source, target FROM edges LIMIT 10;')
--["ok"]
SELECT * functions.pl_1('SELECT source, target FROM edges LIMIT 1;')
--[XX000] ERROR: plcontainer: Error receiving data from the client. Maybe retry later. (plcontainer.c:362) Где: PLContainer function "pl_1"

Pl\Container version from 6X_STABLE branch.
Stacktrace:

2021-06-11 10:58:07.014287 UTC,"gpadmin","xxx",p14707,th834987200,"10.0.0.4","55586",2021-06-11 10:54:34 UTC,0,con5823,cmd13,seg-1,,dx14856,,sx1,"ERROR","XX000","plcontainer: Error receiving data from the client. Maybe retry later. (plcontainer.c:362)",,,,,"PLContainer function ""pl_1""","SELECT pl_1::jsonb FROM functions.pl_1('select 1 as asd')",0,,"plcontainer.c",362,"Stack trace:
1    0x55a26a8dc78b postgres errstart + 0x1fb
2    0x55a26a8df69c postgres elog_finish + 0xcc
3    0x7fab18c8b1cb plcontainer.so <symbol not found> + 0x18c8b1cb
4    0x7fab18c8b531 plcontainer.so <symbol not found> + 0x18c8b531
5    0x7fab18c8bbfa plcontainer.so plcontainer_call_handler + 0x18a
6    0x55a26a57234f postgres <symbol not found> + 0x6a57234f
7    0x55a26a577847 postgres ExecProject + 0x177
8    0x55a26a599f2a postgres ExecResult + 0x17a
9    0x55a26a569d98 postgres ExecProcNode + 0x3e8
10   0x55a26a59e256 postgres ExecSetParamPlan + 0x196
11   0x55a26a56fa88 postgres <symbol not found> + 0x6a56fa88
12   0x55a26a577847 postgres ExecProject + 0x177
13   0x55a26a599f2a postgres ExecResult + 0x17a
14   0x55a26a569d98 postgres ExecProcNode + 0x3e8
15   0x55a26a59ee38 postgres <symbol not found> + 0x6a59ee38
16   0x55a26a5780bf postgres ExecScan + 0xff
17   0x55a26a569e18 postgres ExecProcNode + 0x468
18   0x55a26a560de2 postgres <symbol not found> + 0x6a560de2
19   0x55a26a56170c postgres standard_ExecutorRun + 0x31c
20   0x55a26a756517 postgres <symbol not found> + 0x6a756517
21   0x55a26a7587e9 postgres PortalRun + 0x369
22   0x55a26a754ed5 postgres PostgresMain + 0x19f5
23   0x55a26a337ded postgres <symbol not found> + 0x6a337ded
24   0x55a26a6d0610 postgres PostmasterMain + 0x1340
25   0x55a26a33d327 postgres main + 0x4b7
26   0x7fab2e641bf7 libc.so.6 __libc_start_main + 0xe7
27   0x55a26a34927a postgres _start + 0x2a
"
2021-06-11 10:55:12.009128 UTC,"gpadmin","xxx",p14707,th834987200,"10.0.0.4","55586",2021-06-11 10:54:34 UTC,0,con5823,cmd10,seg-1,,dx14854,,sx1,"LOG","00000","An exception was encountered during the execution of st
atement: SELECT pl_1::jsonb FROM functions.pl_1('select 1 as asd')",,,,,,,0,,,,
2021-06-11 10:55:14.579691 UTC,"gpadmin","xxx",p14779,th834987200,"10.0.0.4","55586",2021-06-11 10:54:34 UTC,0,con5823,cmd9,seg-1,,,,sx1,"LOG","00000","CURL response code is 404. CURL response message is {""message"
":""No such container: c9ccb625a537fee5cf748ee2a3c2f16e0fc6e4649b17914336e73b76e8b27caf""}

Why it's happening?

We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.

The labels on this github issue will be updated when the story is started.