Re: pgsql: Add GUC to enable compression of full page images stored in WAL.

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, Fujii Masao <fujii(at)postgresql(dot)org>, pgsql-committers <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Add GUC to enable compression of full page images stored in WAL.
Date: 2015-03-15 01:42:04
Message-ID: CAHGQGwEYdgOi7u5bn_qH6MfmpjCOeN1MAL9020bb=WC=criusg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Sun, Mar 15, 2015 at 5:23 AM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> On 3/12/15 6:13 AM, Fujii Masao wrote:
>> On Wed, Mar 11, 2015 at 11:30 PM, Michael Paquier
>> <michael(dot)paquier(at)gmail(dot)com> wrote:
>>> On Wed, Mar 11, 2015 at 11:18 PM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
>>>> On 2015-03-11 06:54:16 +0000, Fujii Masao wrote:
>>>>> Add GUC to enable compression of full page images stored in WAL.
>>>>
>>>> This triggers a couple warnings here (gcc 4.9 and 5):
>>>>
>>>> /home/andres/src/postgresql/src/backend/access/transam/xloginsert.c: In function 'XLogInsert':
>>>> /home/andres/src/postgresql/src/backend/access/transam/xloginsert.c:670:5: warning: 'cbimg.hole_length' may be used uninitialized in this function [-Wmaybe-uninitialized]
>>>> memcpy(scratch, &cbimg,
>>>> ^
>>>> /home/andres/src/postgresql/src/backend/access/transam/xloginsert.c:494:33: note: 'cbimg.hole_length' was declared here
>>>> XLogRecordBlockCompressHeader cbimg;
>>>> ^
>>>> /home/andres/src/postgresql/src/backend/access/transam/xloginsert.c:668:20: warning: 'hole_length' may be used uninitialized in this function [-Wmaybe-uninitialized]
>>>> if (hole_length != 0 && is_compressed)
>>>> ^
>>>> /home/andres/src/postgresql/src/backend/access/transam/xloginsert.c:497:10: note: 'hole_length' was declared here
>>>> uint16 hole_length;
>>>>
>>>> I've not checked whether they're spurious or not.
>>
>> Thanks for the report! We can suppress those warnings just by
>> initializing cbimg.hole_length and hole_length. But I'd like to apply
>> the attached patch which not only initializes the variable but also
>> refactors the related code.
>
> Could you please fix this compiler warning soon?

Sorry for the delay. Pushed.

Regards,

--
Fujii Masao

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Magnus Hagander 2015-03-15 15:07:06 Re: pgsql: Invent PGC_SU_BACKEND and mark log_connections/log_disconnection
Previous Message Fujii Masao 2015-03-15 01:41:27 pgsql: Suppress maybe-uninitialized compiler warnings.