Re: Avoid overflow with simplehash - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: Avoid overflow with simplehash
Date
Msg-id CE03E888-D183-46E5-96A3-193CCFE9D658@yesql.se
Whole thread Raw
In response to Re: Avoid overflow with simplehash  (Ranier Vilela <ranier.vf@gmail.com>)
Responses Re: Avoid overflow with simplehash
List pgsql-hackers
> On 6 Jul 2023, at 16:42, Ranier Vilela <ranier.vf@gmail.com> wrote:
> Em qui., 6 de jul. de 2023 às 11:37, Daniel Gustafsson <daniel@yesql.se <mailto:daniel@yesql.se>> escreveu:

> #define SH_MAX_SIZE (((uint64) PG_UINT32_MAX) + 1)
> This is Assert, that is, in production this test is not done.

Correct, which implies that it's a test for something which is deemed highly
unlikely to happen in production.

> If the empty element is not found, startelem has PG_UINT64_MAX value,
> which do not fit in uint32.

Can you show an example where the hash isn't grown automatically to accomodate
this such that the assertion is tripped?

--
Daniel Gustafsson




pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: Example Table AM implementation
Next
From: Karina Litskevich
Date:
Subject: Re: Avoid unncessary always true test (src/backend/storage/buffer/bufmgr.c)