From: | Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru> |
---|---|
To: | Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> |
Cc: | Piotr Stefaniak <postgres(at)piotr-stefaniak(dot)me>, "pgsql-committers(at)lists(dot)postgresql(dot)org" <pgsql-committers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: pgsql: Increase upper limit for vacuum_cleanup_index_scale_factor |
Date: | 2019-04-15 18:57:55 |
Message-ID: | CAPpHfdtVnK_m3WDuEfkzFjfPvxy=nyx-7RgJiYL0hYa8HF1AXA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
On Mon, Apr 15, 2019 at 11:28 AM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
> On Mon, Apr 15, 2019 at 11:57 AM Alexander Korotkov
> <a(dot)korotkov(at)postgrespro(dot)ru> wrote:
> >
> > Hi!
> >
> > On Sun, Apr 14, 2019 at 11:00 PM Piotr Stefaniak
> > <postgres(at)piotr-stefaniak(dot)me> wrote:
> > > UB Sanitizer points out that prev_num_heap_tuples is sometimes 0,
> > > leading to division by 0 in
> > > (info->num_heap_tuples - prev_num_heap_tuples) /
> > > prev_num_heap_tuples >= cleanup_scale_factor)
> > > which are currently lines 839-840 in nbtree.c.
>
> Thank you pointing out it.
>
> > >
> > > Attaching my idea of a fix.
> >
> > Thank you for noticing. BTW, I've more trivial idea for fixing this: replace
> > prev_num_heap_tuples < 0
> > with
> > prev_num_heap_tuples <= 0
> >
> > If prev_num_heap_tuples == 0, subsequent part of expression isn't
> > evaluated because result is known to be true. And I think it's right
> > to don't skip cleanup when prev_num_heap_tuples == 0.
>
> +1. It looks good to me.
Thank you for the feedback!
Pushed.
------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2019-04-15 20:20:16 | pgsql: Avoid possible regression test instability in timestamp.sql. |
Previous Message | Alexander Korotkov | 2019-04-15 18:57:03 | pgsql: Fix division by zero in _bt_vacuum_needs_cleanup() |