On 07/31/2015 10:43 AM, Robert Haas wrote:
> On Thu, Jul 30, 2015 at 9:17 PM, Josh Berkus <j...@agliodbs.com> wrote:
>> In guc.c, the maximum for wal_buffers is INT_MAX.  However, wal_buffers
>> is actually measured in 8KB buffers, not in bytes.  This means that
>> users are able to set wal_buffers > 2GB.  When the database is started,
>> this can cause a core dump if the WAL offset is > 2GB.
> 
> Why does this cause a core dump?  We could consider fixing whatever
> the problem is rather than capping the value.

The underlying issue is that byte position in wal_buffers is a 32-bit
INT, so as soon as you exceed that, core dump.

Given that useful ranges for wal_buffers are in the 8MB to 128MB range,
I don't see that a cap at 2GB is much of a burden.  For that reason, I'd
prefer capping the value to replumbing.  We have not previously
documented the  limit for this parameter, which is probably how the bug
happened in the first place.  Clearly no user has been setting it above
2GB, or they would have been core dumping.

Oh, and yes, I think this should be backported; this issue exists in all
supported versions.

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to