A database panic occurs with a SIGSEGV signal when executing queries utilizing the GPORCA optimizer. This happens specifically when an ordered-set aggregate (such as percentile_cont, percentile_disc, or median) is used in a Common Table Expression (CTE).
Coordinator logs will display a PANIC and stack trace similar to following:
"PANIC","XX000","Unexpected internal error: Master process received signal SIGSEGV",,,,,,,0,,,,"
1 0x7f45870bd990 libpthread.so.0 <symbol not found> + 0x870bd990
2 0xe5cb31 postgres _ZN4gpmd15CMDFunctionGPDBD1Ev (CMemoryPool.h:240)
3 0xfdb133 postgres _ZN5gpopt8CMDCache5ResetEv (CMemoryPool.h:240)
4 0x116dac5 postgres _ZN9COptTasks12OptimizeTaskEPv (COptTasks.cpp:996)
...
10 0x116ae8e postgres _ZN9COptTasks18GPOPTOptimizedPlanEP5QueryP11SOptContext (COptTasks.cpp:1334)
...
Greenplum 7.x prior to 7.8.4
This issue is caused by a double-free memory bug in the GPORCA optimizer.
This defect is resolved in Tanzu Greenplum version 7.8.4.
To resolve the issue:
Upgrade the environment to Tanzu Greenplum 7.8.4 or later.
Review the Tanzu Greenplum Release Notes for further details.