Re: pgsql: Move I/O before the index_update_stats() buffer lock region.

From: Noah Misch <noah(at)leadboat(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Move I/O before the index_update_stats() buffer lock region.
Date: 2024-11-03 03:10:27
Message-ID: 20241103031027.09.nmisch@google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Sat, Nov 02, 2024 at 10:32:56PM -0400, Tom Lane wrote:
> Noah Misch <noah(at)leadboat(dot)com> writes:
> > Move I/O before the index_update_stats() buffer lock region.
>
> In branches before 17, this commit is causing some compilers
> to complain:
>
> index.c: In function 'index_update_stats':
> index.c:2913:24: warning: 'relpages' may be used uninitialized in this function [-Wmaybe-uninitialized]
> if (rd_rel->relpages != (int32) relpages)
> ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
>
> I'm seeing that with RHEL8's gcc 8.5.0, and trawling the buildfarm
> shows at least 40 animals similarly unhappy. (I noticed this because
> mamba, which is using -Werror, is actually failing.)

Hopefully now the code won't fool any compiler.

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2024-11-03 03:13:57 Re: pgsql: Move I/O before the index_update_stats() buffer lock region.
Previous Message Noah Misch 2024-11-03 02:44:33 pgsql: Suppress new "may be used uninitialized" warning.