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

BUGs in Zipfian generator #34

Open
Losk-x opened this issue Jul 1, 2024 · 2 comments
Open

BUGs in Zipfian generator #34

Losk-x opened this issue Jul 1, 2024 · 2 comments

Comments

@Losk-x
Copy link

Losk-x commented Jul 1, 2024

ZETAN is not a constant

static constexpr double ZETAN = 26.46902820178302;

Though this line is directly copied from ycsb, it neglects the fact that ZETAN is determined by the num_keys_ and ZIPFIAN_CONSTANT.
In ycsb's implementation, the num_keys_ is also fixed, so the ZETAN can be a constant. See:

https://github.com/brianfrankcooper/YCSB/blob/dbe92a1fbd24be061fcf01e56838afb83e6f9c58/core/src/main/java/site/ycsb/generator/ScrambledZipfianGenerator.java#L35

https://github.com/brianfrankcooper/YCSB/blob/dbe92a1fbd24be061fcf01e56838afb83e6f9c58/core/src/main/java/site/ycsb/generator/ZipfianGenerator.java#L244

Hash function's keyspace may be too small

inline uint32_t fnv1a(int fourBytes, uint32_t hash = SEED) {

Using a fnv1a-32 is not consistent with yscb (fnv1a-64). It may cause hash collision and make keyspace not fully-covered when num_keys_ is closed with 2^32-1.

@ZEMINGMA
Copy link

ZEMINGMA commented Jul 1, 2024 via email

@Losk-x
Copy link
Author

Losk-x commented Jul 2, 2024

Test result of the wrong generator in 200M dataset:
10B keys are generated, and only 62.5% can be covered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants