From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Don't try to read a multi-GB pg_stat_statements file in one call |
Date: | 2021-10-31 23:14:12 |
Message-ID: | E1mhK1k-0002lr-Ev@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Don't try to read a multi-GB pg_stat_statements file in one call.
Windows fails on a request to read() more than INT_MAX bytes,
and perhaps other platforms could have similar issues. Let's
adjust this code to read at most 1GB per call.
(One would not have thought the file could get that big, but now
we have a field report of trouble, so it can. We likely ought to
add some mechanism to limit the size of the query-texts file
separately from the size of the hash table. That is not this
patch, though.)
Per bug #17254 from Yusuke Egashira. It's been like this for
awhile, so back-patch to all supported branches.
Discussion: https://postgr.es/m/17254-a926c89dc03375c2@postgresql.org
Branch
------
REL9_6_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/fdb60ca83d030e77f1e0db4646954d9eb8492ee4
Modified Files
--------------
contrib/pg_stat_statements/pg_stat_statements.c | 45 ++++++++++++++++---------
1 file changed, 29 insertions(+), 16 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2021-11-01 02:41:26 | pgsql: Preserve opclass parameters across REINDEX CONCURRENTLY |
Previous Message | Tom Lane | 2021-10-31 22:12:58 | pgsql: Doc: improve README files associated with TAP tests. |