Re: patch: prevent user from setting wal_buffers over 2GB bytes - Mailing list pgsql-hackers

From Robert Haas
Subject Re: patch: prevent user from setting wal_buffers over 2GB bytes
Date
Msg-id CA+TgmoYSYD7dRVvcdRAzRA1WR7sT2vGRT83NKLM+ohRU4ZZRxg@mail.gmail.com
Whole thread Raw
In response to Re: patch: prevent user from setting wal_buffers over 2GB bytes  (Josh Berkus <josh@agliodbs.com>)
Responses Re: patch: prevent user from setting wal_buffers over 2GB bytes
List pgsql-hackers
On Fri, Jul 31, 2015 at 8:09 PM, Josh Berkus <josh@agliodbs.com> wrote:
> On 07/31/2015 10:43 AM, Robert Haas wrote:
>> On Thu, Jul 30, 2015 at 9:17 PM, Josh Berkus <josh@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.

OK.  So capping it sounds like the right approach, then.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Kevin Grittner
Date:
Subject: BRIN trivial tweaks
Next
From: Robert Haas
Date:
Subject: Re: Minimum tuple threshold to decide last pass of VACUUM