From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: John Naylor <john.naylor@enterprisedb.com>
Cc: tharakan@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17774: Assert triggered on brin_minmax_multi.c
Date: Wed, 08 Feb 2023 10:03:01 -0500
Message-ID: <3485884.1675868581@sss.pgh.pa.us> (raw)
In-Reply-To: <20230208100658.mz2kkeruoma6iqtw@ddolgov.remote.csb>
References: <17774-c6f3e36dd4471e67@postgresql.org>
<CAFBsxsEMigeTVhBOpsBHw+SJS1n776akNqVC8ATEDmGo_OPgrw@mail.gmail.com>
<20230208100658.mz2kkeruoma6iqtw@ddolgov.remote.csb>
Dmitry Dolgov <9erthalion6@gmail.com> writes:
> The negative delta might be only a consequence. From what I see it's
> called from build_distances, and the idea is to find the gaps between
> the max value of the current interval and the min value of the next one,
> so they should be ordered and delta should be always positive.
I'd believe this argument more readily if the calculation weren't being
done in float arithmetic. Since it is, you're at the mercy of roundoff
error ... and that small negative delta could certainly pass for
roundoff error.
Clamping the result to [0,1] would be a brighter plan than just asserting
that it's in-range.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, 9erthalion6@gmail.com, john.naylor@enterprisedb.com, tharakan@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17774: Assert triggered on brin_minmax_multi.c
In-Reply-To: <3485884.1675868581@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox