Thread: Incorrect overflow check condition for WAL segment size

Incorrect overflow check condition for WAL segment size

From
Kuntal Ghosh
Date:
Hi all,

Although we restrict the WAL segment size to 64 MB as upper limit, the
following piece of code in guc.c (line 715) seems confusing to me.

#if XLOG_SEG_SIZE < (1024*1024) || XLOG_BLCKSZ > (1024*1024*1024)
#error XLOG_SEG_SIZE must be between 1MB and 1GB
#endif

Either the comment is wrongly written or the check for overflow
condition has to be fixed. Assuming the overflow check condition to be
erroneous, I've attached a patch to fix this.

--
Thanks & Regards,
Kuntal Ghosh
EnterpriseDB: http://www.enterprisedb.com

Attachment

Re: Incorrect overflow check condition for WAL segment size

From
Michael Paquier
Date:
On Tue, Nov 8, 2016 at 2:33 PM, Kuntal Ghosh <kuntalghosh.2007@gmail.com> wrote:
> Either the comment is wrongly written or the check for overflow
> condition has to be fixed. Assuming the overflow check condition to be
> erroneous, I've attached a patch to fix this.

Good catch. Interesting copy-pasto from 88e9823.
-- 
Michael



Re: Incorrect overflow check condition for WAL segment size

From
Robert Haas
Date:
On Tue, Nov 8, 2016 at 1:01 AM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> On Tue, Nov 8, 2016 at 2:33 PM, Kuntal Ghosh <kuntalghosh.2007@gmail.com> wrote:
>> Either the comment is wrongly written or the check for overflow
>> condition has to be fixed. Assuming the overflow check condition to be
>> erroneous, I've attached a patch to fix this.
>
> Good catch. Interesting copy-pasto from 88e9823.

Committed.

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



Re: Incorrect overflow check condition for WAL segment size

From
Markus Nullmeier
Date:
On 11/08/16 18:12, Robert Haas wrote:
> On Tue, Nov 8, 2016 at 1:01 AM, Michael Paquier <michael.paquier@gmail.com> wrote:
>> On Tue, Nov 8, 2016 at 2:33 PM, Kuntal Ghosh <kuntalghosh.2007@gmail.com> wrote:
>>> I've attached a patch to fix this.
>> Good catch. Interesting copy-pasto from 88e9823.
> Committed.

Hmm, somehow this fix (60379f66c8 for master) does not seem to appear
in the 9.5 and 9.6 branches, yet the latter both include commit 88e9823.


-- 
Markus Nullmeier            http://www.g-vo.org
German Astrophysical Virtual Observatory (GAVO)




Re: Incorrect overflow check condition for WAL segment size

From
Robert Haas
Date:
On Wed, Nov 9, 2016 at 12:54 PM, Markus Nullmeier
<dq124@uni-heidelberg.de> wrote:
> On 11/08/16 18:12, Robert Haas wrote:
>> On Tue, Nov 8, 2016 at 1:01 AM, Michael Paquier <michael.paquier@gmail.com> wrote:
>>> On Tue, Nov 8, 2016 at 2:33 PM, Kuntal Ghosh <kuntalghosh.2007@gmail.com> wrote:
>>>> I've attached a patch to fix this.
>>> Good catch. Interesting copy-pasto from 88e9823.
>> Committed.
>
> Hmm, somehow this fix (60379f66c8 for master) does not seem to appear
> in the 9.5 and 9.6 branches, yet the latter both include commit 88e9823.

It didn't seem important to back-patch it, so I didn't.  It also
occurred to me that there was a small chance of breaking the build for
somebody who is skating by today, which would annoy that person
without being likely to benefit anyone else.

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