Re: BUG #17969: Assert failed in bloom_init() when false_positive_rate = 0.25

Masahiko Sawada <sawada.mshk@gmail.com>

From: Masahiko Sawada <sawada.mshk@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: exclusion@gmail.com, Tomas Vondra <tomas.vondra@enterprisedb.com>, pgsql-bugs@lists.postgresql.org
Date: 2023-06-16T02:18:30Z
Lists: pgsql-bugs
On Mon, Jun 12, 2023 at 2:03 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> PG Bug reporting form <noreply@postgresql.org> writes:
> > The following script:
> > CREATE TABLE tbl (i int);
> > CREATE INDEX idx ON tbl USING brin (i int4_bloom_ops(false_positive_rate =
> > 0.25));
> > INSERT INTO tbl VALUES(1);
>
> > triggers an assertion failure:
> > TRAP: failed Assert("(false_positive_rate >= BLOOM_MIN_FALSE_POSITIVE_RATE)
> > && (false_positive_rate < BLOOM_MAX_FALSE_POSITIVE_RATE)"), File:
> > "brin_bloom.c", Line: 282, PID: 1062784
>
> > Reproduced starting from 77b88cd1b.
>
> Hmph.  Surely that should read "false_positive_rate <=
> BLOOM_MAX_FALSE_POSITIVE_RATE" ?

It seems that the minimum false positive rate also doesn't work:

postgres(1:3419179)=# create table t (a int);
CREATE TABLE
postgres(1:3419179)=# create index t_idx on t using brin (a
int4_bloom_ops (false_positive_rate = 0.0001));
CREATE INDEX
postgres(1:3419179)=# insert into t values (1);
2023-06-16 11:14:01.349 JST [3419179] ERROR:  the bloom filter is too
large (8924 > 8144)
2023-06-16 11:14:01.349 JST [3419179] STATEMENT:  insert into t values (1);
ERROR:  the bloom filter is too large (8924 > 8144)

Regards,

-- 
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com



Commits

  1. Enlarge assertion in bloom_init() for false_positive_rate