Hi
> Here's confirmed steps to reproduce
Wow, i confirm this testcase is reproducible for me. On my 4-core desktop i see
"dsa_area could not attach to segment" error after minute or two.
On current REL_11_STABLE branch with PANIC level i see this backtrace for
failed parallel process:
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007f3b36983535 in __GI_abort () at abort.c:79
#2 0x000055f03ab87a4e in errfinish (dummy=dummy@entry=0) at elog.c:555
#3 0x000055f03ab899e0 in elog_finish (elevel=elevel@entry=22,
fmt=fmt@entry=0x55f03ad86900 "dsa_area could not attach to segment") at
elog.c:1376
#4 0x000055f03abaa1e2 in get_segment_by_index (area=area@entry=0x55f03cdd6bf0,
index=index@entry=7) at dsa.c:1743
#5 0x000055f03abaa8ab in get_best_segment (area=area@entry=0x55f03cdd6bf0,
npages=npages@entry=8) at dsa.c:1993
#6 0x000055f03ababdb8 in dsa_allocate_extended (area=0x55f03cdd6bf0,
size=size@entry=32768, flags=flags@entry=0) at dsa.c:701
#7 0x000055f03a921469 in ExecParallelHashTupleAlloc
(hashtable=hashtable@entry=0x55f03cdfd498, size=104,
shared=shared@entry=0x7ffc9f355748) at nodeHash.c:2837
#8 0x000055f03a9219fc in ExecParallelHashTableInsertCurrentBatch
(hashtable=hashtable@entry=0x55f03cdfd498, slot=<optimized out>,
hashvalue=2522126815) at nodeHash.c:1747
#9 0x000055f03a9227ef in ExecParallelHashJoinNewBatch
(hjstate=hjstate@entry=0x55f03cde17b0) at nodeHashjoin.c:1153
#10 0x000055f03a924115 in ExecHashJoinImpl (parallel=true,
pstate=0x55f03cde17b0) at nodeHashjoin.c:534
#11 ExecParallelHashJoin (pstate=0x55f03cde17b0) at nodeHashjoin.c:581
#12 0x000055f03a90d91c in ExecProcNodeFirst (node=0x55f03cde17b0) at
execProcnode.c:445
#13 0x000055f03a905f3b in ExecProcNode (node=0x55f03cde17b0) at
../../../src/include/executor/executor.h:247
#14 ExecutePlan (estate=estate@entry=0x55f03cde0d38, planstate=0x55f03cde17b0,
use_parallel_mode=<optimized out>, operation=operation@entry=CMD_SELECT,
sendTuples=sendTuples@entry=true, numberTuples=numberTuples@entry=0,
direction=ForwardScanDirection, dest=0x55f03cd7e4e8, execute_once=true) at
execMain.c:1723
#15 0x000055f03a906b4d in standard_ExecutorRun (queryDesc=0x55f03cdd13e0,
direction=ForwardScanDirection, count=0, execute_once=execute_once@entry=true)
at execMain.c:364
#16 0x000055f03a906c08 in ExecutorRun
(queryDesc=queryDesc@entry=0x55f03cdd13e0,
direction=direction@entry=ForwardScanDirection, count=<optimized out>,
execute_once=execute_once@entry=true) at execMain.c:307
#17 0x000055f03a90b44f in ParallelQueryMain (seg=seg@entry=0x55f03cd320a8,
toc=toc@entry=0x7f3b2d877000) at execParallel.c:1402
#18 0x000055f03a7ce4cc in ParallelWorkerMain (main_arg=<optimized out>) at
parallel.c:1409
#19 0x000055f03a9e11cb in StartBackgroundWorker () at bgworker.c:834
#20 0x000055f03a9eea1a in do_start_bgworker (rw=rw@entry=0x55f03cd2d460) at
postmaster.c:5698
#21 0x000055f03a9eeb5b in maybe_start_bgworkers () at postmaster.c:5911
#22 0x000055f03a9ef5f0 in sigusr1_handler (postgres_signal_arg=<optimized out>)
at postmaster.c:5091
#23 <signal handler called>
#24 0x00007f3b36a52327 in __GI___select (nfds=nfds@entry=6,
readfds=readfds@entry=0x7ffc9f356160, writefds=writefds@entry=0x0,
exceptfds=exceptfds@entry=0x0, timeout=timeout@entry=0x7ffc9f356150)
at ../sysdeps/unix/sysv/linux/select.c:41
#25 0x000055f03a9effaa in ServerLoop () at postmaster.c:1670
#26 0x000055f03a9f1285 in PostmasterMain (argc=3, argv=<optimized out>) at
postmaster.c:1379
#27 0x000055f03a954f3d in main (argc=3, argv=0x55f03cd03200) at main.c:228
regards, Sergei