Menu

#431 Server crash in case of a 1 coordinator 1 datanode cluster

1.2 Dev Q
open
6
2013-12-02
2013-07-10
Abbas Butt
No

This test case taken from aggregates.sql, can be used to reproduce the crash which is an assertion failure on the datanode

create table varchar_tbl( f1 character varying(4) );
insert into varchar_tbl values('a'), ('ab'), ('abcd'), ('abcd');
select string_agg(distinct f1, ',' order by f1) from varchar_tbl;

It would cause a datanode crash

TRAP: FailedAssertion("!(AggCheckCallContext(fcinfo, ((void *)0)))", File: "varlena.c", Line: 3668)

The explain output is as follows

test=# explain verbose select string_agg(distinct f1, ',' order by f1) from varchar_tbl;
QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------------------------------------
Data Node Scan on "__REMOTE_FQS_QUERY__" (cost=0.00..0.00 rows=0 width=0)
Output: (string_agg(DISTINCT (varchar_tbl.f1)::text, ','::text ORDER BY (varchar_tbl.f1)::text))
Node/s: data_node_1
Remote query: SELECT pg_catalog.string_agg_finalfn(string_agg(DISTINCT (f1)::text, ','::text ORDER BY (f1)::text)) AS string_agg FROM public.varchar_tbl
(4 rows)

Note the call to string_agg_finalfn in the remote query, which causes the assertion failure.

The plan generated in case of more than one datanodes is as follows which works correctly.

test=# explain verbose select string_agg(distinct f1, ',' order by f1) from varchar_tbl;
QUERY PLAN
--------------------------------------------------------------------------------------------------
Aggregate (cost=2.50..2.51 rows=1 width=20)
Output: string_agg(DISTINCT (varchar_tbl.f1)::text, ','::text ORDER BY (varchar_tbl.f1)::text)
-> Data Node Scan on varchar_tbl "_REMOTE_TABLE_QUERY_" (cost=0.00..0.00 rows=1000 width=20)
Output: varchar_tbl.f1
Node/s: data_node_1, data_node_2
Remote query: SELECT f1 FROM ONLY public.varchar_tbl WHERE true
(6 rows)

Discussion

  • Abbas Butt

    Abbas Butt - 2013-07-16
    • milestone: 2663467 --> 1,2 Dev Q
     
  • Koichi Suzuki

    Koichi Suzuki - 2013-12-02
    • assigned_to: Abbas Butt
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.