Re: Bug in huge simplehash - Mailing list pgsql-hackers

From Yura Sokolov
Subject Re: Bug in huge simplehash
Date
Msg-id c900cc323249dfdecb2a151c8aa4b579@postgrespro.ru
Whole thread Raw
In response to Re: Bug in huge simplehash  (Ranier Vilela <ranier.vf@gmail.com>)
Responses Re: Bug in huge simplehash  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-hackers
Ranier Vilela писал 2021-08-10 14:21:
> Em ter., 10 de ago. de 2021 às 05:53, Yura Sokolov
> <y.sokolov@postgrespro.ru> escreveu:
> 
>> 
>> I went to check SH_GROW and.... It is `SH_GROW(SH_TYPE *tb, uint32
>> newsize)`
>> :-(((
>> Therefore when `tb->size == SH_MAX_SIZE/2` and we call `SH_GROW(tb,
>> tb->size * 2)`,
>> then SH_GROW(tb, 0) is called due to truncation.
>> And SH_COMPUTE_PARAMETERS is also accepts `uint32 newsize`.
>> 
>> Ahh... ok, patch is updated to fix this as well.
> 
> It seems that we need to fix the function prototype too.
> 
> /* void <prefix>_grow(<prefix>_hash *tb) */
> -SH_SCOPE void SH_GROW(SH_TYPE * tb, uint32 newsize); +SH_SCOPE void
> SH_GROW(SH_TYPE * tb, uint64 newsize);

Ahh... Thank you, Ranier.
Attached v2.

regards,

-----

Yura Sokolov
Attachment

pgsql-hackers by date:

Previous
From: "Drouvot, Bertrand"
Date:
Subject: Re: [bug] Logical Decoding of relation rewrite with toast does not reset toast_hash
Next
From: Simon Riggs
Date:
Subject: Re: WIP: System Versioned Temporal Table