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

fix: new variant hashing #145

Merged
merged 7 commits into from
Oct 27, 2023
Merged

fix: new variant hashing #145

merged 7 commits into from
Oct 27, 2023

Conversation

sjaanus
Copy link
Contributor

@sjaanus sjaanus commented Oct 26, 2023

What

Uses a new seed for ensuring a fair distribution for variants.

Background

After a customer reported that variant distribution seemed skewed we performed some testing and found that since we use the same hash string for both gradual rollout and variant allocation we'd reduced the set of groups we could get to whatever percentage our gradual rollout was set.

Example

Take a gradualRollout of 10%, this will select normalized hashes between 1 and 10, when we then again hash the same string that gave us between 1 and 10, but with modulo 1000 for variants, this will only give us 100 possible groups, instead of the expected 1000.

Fix

Force the normalization to accept a seed, and make sure to use a new seed when normalizing the variant distribution hash.

Worth noting

This will require release 4.0.0, since we are changing how hashing works.

@chriswk
Copy link
Contributor

chriswk commented Oct 26, 2023

Client Spec change is here: Unleash/client-specification#68. It was only one failing client spec test for me

@sjaanus sjaanus merged commit b863938 into v3 Oct 27, 2023
9 checks passed
@sjaanus sjaanus deleted the new-variant-hasing branch October 27, 2023 12:46
gastonfournier added a commit that referenced this pull request Nov 20, 2023
gastonfournier added a commit that referenced this pull request Nov 21, 2023
* Revert "upgrade: 4.0.0 release (#147)"
This reverts commit 0efdcc8.

* Revert "fix: new variant hashing (#145)"
This reverts commit b863938.

* Update version
* Don't wait 10 minutes to fail on timeout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants