Re: Bug? ExecChooseHashTableSize() got assertion failed with crazy number of rows - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: Bug? ExecChooseHashTableSize() got assertion failed with crazy number of rows
Date
Msg-id 1594535175.4597103.1439991651739.JavaMail.yahoo@mail.yahoo.com
Whole thread Raw
In response to Re: Bug? ExecChooseHashTableSize() got assertion failed with crazy number of rows  (Kouhei Kaigai <kaigai@ak.jp.nec.com>)
Responses Re: Bug? ExecChooseHashTableSize() got assertion failed with crazy number of rows  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Kouhei Kaigai <kaigai@ak.jp.nec.com> wrote:

> we may need a couple of overhaul around HashJoin to support large
> size of data, not only nbuckets around 0x80000000.

Perhaps, but this is a clear bug, introduced to the 9.5 code, with
an obvious fix; so I've pushed the change from 1 to 1L on that left
shift.  There was clearly an attempt in surrounding code to deal
with size overruns by using a long, applying a min(), and casting
to int; this one statement just missed a trick.  If we need to
further constrain sizes to keep within allocation limits, that
seems like an entirely separate patch.

Thanks for finding and analyzing this and providing a patch!


--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: allowing wal_level change at run time
Next
From: Tom Lane
Date:
Subject: Re: Proposal: Implement failover on libpq connect level.