Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SERIOUS BUG]: negative key cache hit problem #369

Closed
UallenQbit opened this issue Jan 9, 2024 · 3 comments
Closed

[SERIOUS BUG]: negative key cache hit problem #369

UallenQbit opened this issue Jan 9, 2024 · 3 comments
Labels
kind/bug Something is broken.

Comments

@UallenQbit
Copy link

UallenQbit commented Jan 9, 2024

What version of Ristretto are you using?

github.com/dgraph-io/ristretto v0.1.1

What version of Go are you using?

go version go1.21.5 windows/amd64

Have you tried reproducing the issue with the latest release?

None

What is the hardware spec (RAM, CPU, OS)?

Intel Core i9 12900HX | 64.0GB | Windows 11

What steps will reproduce the bug?

z/z.go func KeyToHash
image_2024-01-09_15-24-55
if int int32 int64 is negative, the result will be 18446744073709551516 when converting uint64
this will cause everything to hit one shards, which will cause the performance of negative keys to seriously degrade!

@UallenQbit UallenQbit added the kind/bug Something is broken. label Jan 9, 2024
@Yonghui-Lee
Copy link

@UallenQbit When converting a negative integer into uint64, the result won't always be 18446744073709551516. Actually, the result will be the complemnt code of it. So different negative keys won't hit the same shard.

@UallenQbit
Copy link
Author

@UallenQbit When converting a negative integer into uint64, the result won't always be 18446744073709551516. Actually, the result will be the complemnt code of it. So different negative keys won't hit the same shard.

Where is the other code for this?

@Yonghui-Lee
Copy link

Yonghui-Lee commented Feb 9, 2024

I mean the result will be two's complement of the negative number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something is broken.
Development

No branches or pull requests

2 participants