dsa_allocate could not find 4 free pages

From: Mark Dilger <hornschnorter(at)gmail(dot)com>
To: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: dsa_allocate could not find 4 free pages
Date: 2017-12-05 17:17:18
Message-ID: 32C7E4EE-2577-4073-A921-854078CA42F1@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hackers,

I'm getting the error in $subject and am only posting here because (a) the comments
in src/backend/utils/mmgr/dsa.c circa line 720 suggest that this is a bug, and (b) the
DSA code appears to be fairly new to the postgresql project, and perhaps not fully
debugged.

I am running against a build from 291a31c42c893574e9676e00121e6c6915a59de5
REL_10_STABLE, on centos linux.

I'm not asking for help configuring my system. If this is a run of the mill out of memory
type error, I'll deal with it myself. But if this indicates a bug, I'll be happy to try to distill
what I'm doing to a test case that I can share. (I've only hit this once, and have little
idea whether it would be reproducible.) The gist of the query was an array_agg over
the results of a parallel query over a partitioned table, executed from within a plpgsql
function, like:

SELECT ARRAY_AGG((a, latest, timelogged, b, cnt)::custom_composite_type) AS trans FROM
(SELECT a, b, timelogged, MAX(timelogged) OVER (PARTITION BY a) AS latest, SUM(cnt) AS cnt FROM
(SELECT a, b, timelogged, COUNT(*) AS cnt
FROM mytable
WHERE a= ANY('{65537,65538,65539,65540,65541,65542,65543,65544}'::OID[])
AND timelogged >= '2017-12-04 16:12:50-08'::TIMESTAMP
AND timelogged < '2017-12-04 17:12:50-08'::TIMESTAMP
GROUP BY a, b, timelogged
) AS ss
GROUP BY a, b, timelogged
) AS s

If this is not a bug, but rather something that users can hit through normal resource
exhaustion, then perhaps the comments in dsa.c can be changed to make that clear.

Thanks!

mark

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2017-12-05 17:45:01 Re: Usage of epoch in txid_current
Previous Message Peter Geoghegan 2017-12-05 17:13:53 Re: Add PGDLLIMPORT lines to some variables