Pivotal Knowledge Base


Running a “UNION ALL” query in HAWQ, causes a segment to panic


Product Version
 Pivotal HDB / HAWQ 1.2, 1.3, 2.0.0


When running a query in HAWQ that contains "UNION ALL," a HAWQ segment may panic with an error similar to this: 

2016-08-23 22:05:07.475809 KST,"gpadmin","gpadmin",p274040,th-471918464,"[local]",,2016-08-23 22:05:05 KST,262574,con17648,cmd20,seg-1,,,x262574,sx1,"LOG","00000","ConnID 10. Returned resource to resource manager.",,,,,,"insert into test_2 select i, i from generate_series(1, 100) i;",0,,"rmcomm_QD2RM.c",951, 
2016-08-23 22:05:07.476021 KST,,,p553064,th-471918464,,,,0,con4,,seg-10000,,,,,"WARNING","01000","Resource manager finds possible not handled resource request from ConnID 10.",,,,,,,0,,"requesthandler.c",282, 
2016-08-23 22:05:07.476060 KST,,,p553064,th-471918464,,,,0,con4,,seg-10000,,,,,"LOG","00000","ConnID 10. Connection is unregistered.",,,,,,,0,,"requesthandler.c",300, 
2016-08-23 22:05:07.476461 KST,"gpadmin","gpadmin",p274040,th-471918464,"[local]",,2016-08-23 22:05:05 KST,262574,con17648,cmd20,seg-1,,,x262574,sx1,"LOG","00000","ConnID 10. Unregistered from HAWQ resource manager.",,,,,,"insert into test_2 select i, i from generate_series(1, 100) i;",0,,"rmcomm_QD2RM.c",661, 
2016-08-23 22:05:08.066560 KST,,,p274040,th0,,,2016-08-23 22:05:05 KST,0,con17648,cmd21,seg-1,,,,,"PANIC","XX000","Unexpected internal error: Master process received signal SIGSEGV",,,,,,,0,,,,"1 0x86e01e postgres <symbol not found> + 0x86e01e 
2 0x3ddb60f710 libpthread.so.0 <symbol not found> + 0xdb60f710 
3 0x593bd2 postgres <symbol not found> + 0x593bd2 
4 0x597d85 postgres <symbol not found> + 0x597d85 
5 0x59d675 postgres <symbol not found> + 0x59d675 
6 0x59dc8e postgres <symbol not found> + 0x59dc8e 
7 0x59e4ef postgres <symbol not found> + 0x59e4ef 
8 0x59e701 postgres <symbol not found> + 0x59e701 
9 0x59c429 postgres <symbol not found> + 0x59c429 
10 0x59db37 postgres <symbol not found> + 0x59db37 
11 0x59dc8e postgres <symbol not found> + 0x59dc8e 
12 0x59e11c postgres parse_analyze + 0x5c 
13 0x7aed03 postgres <symbol not found> + 0x7aed03 
14 0x7b07fc postgres PostgresMain + 0x11fc 
15 0x763f23 postgres <symbol not found> + 0x763f23 
16 0x76467d postgres <symbol not found> + 0x76467d 
17 0x7664ae postgres PostmasterMain + 0xc7e 
18 0x6c072a postgres main + 0x48a 
19 0x3ddb21ed5d libc.so.6 __libc_start_main + 0xfd 
20 0x4a14e9 postgres <symbol not found> + 0x4a14e9 


This is caused by a software defect, GPSQL-3296.

A query that may cause this is:

drop table if exists test_1; 
drop table if exists test_2; 

create table test_1 (a int, b varchar(100)); 
create table test_2 (a int, b varchar(100)); 

insert into test_1 select i, i from generate_series(1, 100) i; 
insert into test_2 select i, i from generate_series(1, 100) i; 

create table test_union_all 
select a, b from test_1 
union all 
select a, b from test_2 
distributed randomly; 



Avoid using "UNION ALL" within queries. Depending on the query, it may be possible to use "Copy table as select" to insert data into a new table instead.


This issue is planned to be fixed in Pivotal HDB 2.0.1. Review the release notes once released to confirm if the defect is fixed. 



Powered by Zendesk