Pivotal Knowledge Base

Follow

Master's QP PANIC on cdb_grouping_planner

Environment

Pivotal Greenplum (GPDB) 4.3.x

Symptoms

Customer may run into the Master PANIC issue as below(from the master log):

2    0xc2f03c postgres <symbol not found> (cdbgroup.c:3695)
3    0x8c113b postgres expression_tree_mutator (clauses.c:3948)
4    0x8c069d postgres expression_tree_mutator (clauses.c:3913)
5    0x8c069d postgres expression_tree_mutator (clauses.c:3913)
6    0x8c113b postgres expression_tree_mutator (clauses.c:3948)
7    0xc369de postgres cdb_grouping_planner (cdbgroup.c:1695)
8    0x8a2d38 postgres <symbol not found> (plangroupext.c:1139)
9    0x8a5ebf postgres <symbol not found> (plangroupext.c:970)
10   0x8a7a73 postgres plan_grouping_extension (plangroupext.c:1740)
11   0x894e23 postgres <symbol not found> (planner.c:1882)
12   0x89737b postgres subquery_planner (planner.c:811)
13   0x85ace9 postgres <symbol not found> (allpaths.c:675)
14   0x85b68b postgres make_one_rel (allpaths.c:199)
15   0x890708 postgres query_planner (planmain.c:236)
16   0x8944f0 postgres <symbol not found> (planner.c:1525)
17   0x897fab postgres <symbol not found> (planner.c:811)
18   0x898686 postgres standard_planner (planner.c:395)
19   0x898cce postgres planner (planner.c:295)
20   0x995637 postgres pg_plan_queries (postgres.c:880)
21   0x7922ba postgres SPI_prepare (spi.c:1557)
22   0x7f725fd85f2d ??:0
23   0x7f725fd889fe ??:0
24   0x7f725fd8ab1b ??:0
25   0x7f725fd89d24 ??:0
26   0x7f725fd8ac33 ??:0
27   0x7f725fd8cc04 ??:0
28   0x7f725fd8a009 ??:0
29   0x7f725fd8f605 ??:0
30   0x7f725fd800fb ??:0
31   0x75e4a6 postgres ExecMakeTableFunctionResult (execQual.c:1978)
32   0x786def postgres <symbol not found> (nodeFunctionscan.c:79)
33   0x756215 postgres ExecProcNode (execProcnode.c:945)
34   0x74bc5c postgres <symbol not found> (execMain.c:2551)
35   0x74c468 postgres ExecutorRun (execMain.c:908)
36   0x99d899 postgres PortalRun (pquery.c:1259)
37   0x992229 postgres <symbol not found> (postgres.c:2754)

Resolution

This is a known caused by the Distinct Qualified Aggregates (DQA) and grouping sets (GROUPING SET, ROLLUP, CUBE), GPDB planner will crash while producing a plan with Append. Below is an example SQL caused this issue:

select coalesce(a.eparchy_code,'9999') as eparchy_code ,coalesce(a.city_code,'--') 
as city_code ,count(distinct case when sale_mode=1 then a.imei end)
as lte_usr_own_cnt ,count(distinct case when sale_mode=0 then a.imei end)
as lte_usr_out_cnt from dwctr.tc_4g_term_user_yj_mon a group by rollup(a.eparchy_code ,a.city_code)

We can add below GUC in session level as the workaround:

set gp_enable_groupext_distinct_pruning=off;

Or we can ask the customer to upgrade to 4.3.16.0 which contains the bug fix.

Comments

Powered by Zendesk