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

Implementation of jump consistent hashing for selecting servers #110

Closed
wants to merge 1 commit into from

Conversation

56quarters
Copy link
Owner

This change adds new logic for selecting which server owns a particular key based on the jump consistent hash. This logic is much faster than the existing rendezvous hashing but is more operationally fragile.

Using jump consistent hashing requires that servers are always in the same order and that servers are added and removed from the end of this list, think how statefulsets in Kubernetes work.

It's not currently possible to make use of this in mtop since we have no way to look up the names of servers until we add support for SRV DNS records. Until then, servers are ordered by their SocketAddr which means they would end up being removed from the middle of the list which completely breaks jump consistent hashing.

Depends on #107

This change adds new logic for selecting which server owns a particular
key based on the jump consistent hash. This logic is much faster than
the existing rendezvous hashing but is more operationally fragile.

Using jump consistent hashing requires that servers are always in the
same order and that servers are added and removed from the end of this
list, think how statefulsets in Kubernetes work.

It's not currently possible to make use of this in mtop since we have
no way to look up the names of servers until we add support for SRV
DNS records. Until then, servers are ordered by their SocketAddr which
means they would end up being removed from the middle of the list
which completely breaks jump consistent hashing.

Depends on #107
@56quarters 56quarters added enhancement New feature or request area:client Relating to the Memcached client labels Jun 15, 2024
@56quarters
Copy link
Owner Author

Closing since jump hashing isn't needed for mtop or mc: performance of rendezvous hashing is fine and more operationally robust. This can now be implemented outside of the crate if really needed due to the Selector trait.

@56quarters 56quarters closed this Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:client Relating to the Memcached client enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant