| From: | PG Bug reporting form <noreply(at)postgresql(dot)org> |
|---|---|
| To: | pgsql-bugs(at)lists(dot)postgresql(dot)org |
| Cc: | jinhui(dot)lai(at)qq(dot)com |
| Subject: | BUG #19363: PostgreSQL shared memory exhaustion during query execution involving views and parallel workers |
| Date: | 2025-12-26 15:07:59 |
| Message-ID: | 19363-8dd32fc7600a1153@postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
The following bug has been logged on the website:
Bug reference: 19363
Logged by: Jinhui Lai
Email address: jinhui(dot)lai(at)qq(dot)com
PostgreSQL version: 18.1
Operating system: ubuntu 22.04
Description:
Hi, PostgreSQL developers:
Thanks for reading my report. I may find a bug. You can reproduce it as
follows:
CREATE TABLE t0(c0 REAL);
CREATE TABLE t1(c0 REAL);
CREATE TABLE t2(c0 REAL) WITH (parallel_workers=1);
CREATE TABLE t3(c0 REAL) WITH (parallel_workers=2);
CREATE VIEW v0(c0, c1, c2) AS (SELECT t0.c0, t1.c0, t2.c0 FROM t0, t1, t2);
SELECT t3.c0 FROM t3 WHERE NOT EXISTS (SELECT 1 FROM v0 WHERE t3.c0 =
v0.c0);
ERROR: could not resize shared memory segment "/PostgreSQL.3961899888" to
33624064 bytes: No space left on device
When executing a query with a NOT EXISTS subquery referencing a view that
joins multiple tables, PostgreSQL fails with a shared memory allocation
error ("could not resize shared memory segment ... No space left on
device"). The issue appears to be related to parallel query execution, as it
occurs when one of the underlying tables (t3) has parallel_workers set to 2,
while another table (t2) has parallel_workers set to 1. The problem
manifests specifically during the query's execution phase, where the planner
attempts to allocate shared memory for parallel workers, suggesting a
possible resource leak or inadequate cleanup of shared memory segments when
parallel queries involve views. The error persists despite sufficient
available system memory, indicating an internal PostgreSQL resource
management issue rather than a system-level memory constraint.
Best regards,
Jinhui Lai
| From | Date | Subject | |
|---|---|---|---|
| Next Message | PG Bug reporting form | 2025-12-26 21:10:46 | BUG #19364: Repository not updating |
| Previous Message | G. Sl | 2025-12-26 11:14:17 | Re: Standby server with cascade logical replication could not be properly stopped under load |