DSA refcnt overflow in pg_stat/could not attach to dynamic shared area

李园园 <summer.li.yuan@qq.com>

From: 李园园 <summer.li.yuan@qq.com>
To: pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Date: 2025-04-24T06:04:59Z
Lists: pgsql-bugs
Our issue is very similar to this  https://www.postgresql.org/message-id/ZnuprZeVZd2X_MOD%40paquier.xyz
Could you confirm which PostgreSQL 15.x minor version includes the fix for this issue? We rely on RPM packages and are unable to apply manual patches. Looking forward to your reply. Thank you!"


1. PostgreSQL 版本: 15.6
2. OS: RHEL8.10&nbsp;&nbsp;
3. ERROR LOGS:
2025-04-24&nbsp; 03:41:32 55000: could not attach to dynamic shared area
2025-04-24 03:41:32client=LOCATION:&nbsp; attach_internal, dsa.c:1334
2025-04-24 03:41:32client=LOG:&nbsp; 00000: background worker "parallel worker" (PID 3936459) exited with exit code 1
2025-04-24 03:41:32client=LOCATION:&nbsp; LogChildExit, postmaster.c:3747
2025-04-24 03:41:32ERROR:&nbsp; 55000: parallel worker failed to initialize
2025-04-24 03:41:32HINT:&nbsp; More details may be available in the server log.
2025-04-24 03:41:32&nbsp; WaitForParallelWorkersToFinish, parallel.c:838
2025-04-24 03:41:32 STATEMENT:&nbsp; select t.id,t.bar_code,t.request_id,t.host_ip,t.resv2,
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;to_char(t.start_time,'yyyymmddhh24miss') as start_time,to_char(t.end_time,'yyyymmddhh24miss') as end_time,
&nbsp; &nbsp; &nbsp; &nbsp; t.equipment_type,t.machine_id,t.control_machine_id,t.station,t.code_type,t.fixture_id,t.cavity,t.line,
&nbsp; &nbsp; &nbsp; &nbsp; t.sw_name,t.sw_version,t.product_no,t.phase_no,t.bill_no,t.config,t.server_node,t.source,t.test_result,
&nbsp; &nbsp; &nbsp; &nbsp; t.cost_time,t.process_rev,t.station_no,t.station_str,
&nbsp; &nbsp; &nbsp; &nbsp; t.client_code,t.is_recheck,t.check_user,to_char(t.indate,'yyyymmddhh24miss.us') as indate,s.para_info,
&nbsp; &nbsp; &nbsp; &nbsp; t.vendor_id,t.draw_name,t.draw_version,to_char(t.calibration_date,'yyyymmddhh24miss') as cali_date
&nbsp; &nbsp; &nbsp; &nbsp; from aaaa&nbsp; &nbsp;t left join bbbbbbb&nbsp; s on s.id = t.id where t.indate &gt; to_timestamp($1,'yyyymmddhh24miss.us')
&nbsp; &nbsp; &nbsp; &nbsp; and t.indate< CLOCK_TIMESTAMP() - interval '5 minute' order by t.indate asc limit 3000
		
5. parameters:
&nbsp; &nbsp;server total memory :512GB
&nbsp; &nbsp;CPU:96 cores
&nbsp; &nbsp;shared_buffers = 128GB
&nbsp; &nbsp;max_connections = 3000
&nbsp; &nbsp;worm_mem = 8M
&nbsp; &nbsp;max_worker_processes = 400&nbsp;&nbsp;
&nbsp; &nbsp;max_parallel_workers_per_gather = 2
&nbsp; &nbsp;max_parallel_maintenance_workers = 2
&nbsp; &nbsp;max_parallel_workers = 64
&nbsp; &nbsp;