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

[Blooms] Consistent hashing via tokens for bloomcompactor #12002

Merged
merged 4 commits into from
Feb 20, 2024

Conversation

owen-d
Copy link
Member

@owen-d owen-d commented Feb 20, 2024

Moves bloom ring ownership back to a traditional consistent hashing mode via tokens. Copies/adapts some dskit ring code where necessary because <ReadRing>.GetTokenRangesForInstance() does not currently support non zone-aware topologies.

This should also break up the bloom compactor's unit of work by making metas for smaller ranges which are now roughly (keyspace_range / num_replicas / tokens_per_replica). With the currently hardcoded 10 tokens per replica, we'll build about 10 times more metas than prior.

Also includes a small change to minimize metric construction during chunk iteration where it's not needed, although this may need some more extensive refactoring for more performance benefits later.

@owen-d owen-d requested a review from a team as a code owner February 20, 2024 00:26
Signed-off-by: Owen Diehl <[email protected]>
return keyspaces, true, nil
}

func tokenRangesForInstance(id string, instances []ring.InstanceDesc) (ranges ring.TokenRanges, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we eventually move that back into dskit?

@owen-d owen-d merged commit 1662298 into grafana:main Feb 20, 2024
8 checks passed
rhnasc pushed a commit to inloco/loki that referenced this pull request Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants