Re: [HACKERS] patch: prevent user from setting wal_buffers over 2GB bytes

2015-08-04 Thread Takashi Horikawa
7; in StartupXLOG(void) -- Takashi Horikawa NEC Corporation Knowledge Discovery Research Laboratories > -Original Message- > From: pgsql-hackers-ow...@postgresql.org > [mailto:pgsql-hackers-ow...@postgresql.org] On Behalf Of Tom Lane > Sent: Tuesday, August 04, 2015 10:50 PM &g

Re: [HACKERS] patch: prevent user from setting wal_buffers over 2GB bytes

2015-08-04 Thread Robert Haas
On Tue, Aug 4, 2015 at 9:52 AM, Andres Freund wrote: >> So my vote is for the original approach. (I've not read Josh's patch, >> so there might be something wrong with it in detail, but I like the >> basic approach.) > > +1 OK, committed and back-patched that all the way back to 9.0. -- Robert

Re: [HACKERS] patch: prevent user from setting wal_buffers over 2GB bytes

2015-08-04 Thread Andres Freund
On 2015-08-04 09:49:58 -0400, Tom Lane wrote: > Takashi Horikawa writes: > Why does this cause a core dump? We could consider fixing whatever > the problem is rather than capping the value. > > > As far as I experiment with my own evaluation environment using > > PostgreSQL-9.4.4 on a

Re: [HACKERS] patch: prevent user from setting wal_buffers over 2GB bytes

2015-08-04 Thread Tom Lane
Takashi Horikawa writes: Why does this cause a core dump? We could consider fixing whatever the problem is rather than capping the value. > As far as I experiment with my own evaluation environment using > PostgreSQL-9.4.4 on a x86_64 Linux, this problem can be fixed with the patch >

Re: [HACKERS] patch: prevent user from setting wal_buffers over 2GB bytes

2015-08-03 Thread Takashi Horikawa
l Message- > From: pgsql-hackers-ow...@postgresql.org > [mailto:pgsql-hackers-ow...@postgresql.org] On Behalf Of Robert Haas > Sent: Tuesday, August 04, 2015 2:29 AM > To: Josh Berkus > Cc: PostgreSQL-development > Subject: Re: [HACKERS] patch: prevent user from setting wal_buf

Re: [HACKERS] patch: prevent user from setting wal_buffers over 2GB bytes

2015-08-03 Thread Robert Haas
On Fri, Jul 31, 2015 at 8:09 PM, Josh Berkus wrote: > On 07/31/2015 10:43 AM, Robert Haas wrote: >> On Thu, Jul 30, 2015 at 9:17 PM, Josh Berkus 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 th

Re: [HACKERS] patch: prevent user from setting wal_buffers over 2GB bytes

2015-07-31 Thread Josh Berkus
On 07/31/2015 10:43 AM, Robert Haas wrote: > On Thu, Jul 30, 2015 at 9:17 PM, Josh Berkus 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 d

Re: [HACKERS] patch: prevent user from setting wal_buffers over 2GB bytes

2015-07-31 Thread Robert Haas
On Thu, Jul 30, 2015 at 9:17 PM, Josh Berkus 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

[HACKERS] patch: prevent user from setting wal_buffers over 2GB bytes

2015-07-30 Thread Josh Berkus
Hackers, 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. Attached patch fixes