Skip to content

Hash keys to servers by default - #8

Merged
lalinsky merged 1 commit into
mainfrom
hash-by-default
Oct 15, 2026
Merged

lalinsky merged 1 commit into
mainfrom
hash-by-default

Conversation

@lalinsky

@lalinsky lalinsky commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

The default hasher was .none, which round-robins: with more than one server, a key was set on one and looked up on another, so a client with default options hardly ever got a hit. Use rendezvous hashing unless asked otherwise.

Summary by CodeRabbit

  • Bug Fixes
    • Key-based operations now select servers using rendezvous hashing by default, improving consistency when storing and retrieving values.

The default hasher was .none, which round-robins: with more than one
server, a key was set on one and looked up on another, so a client with
default options hardly ever got a hit. Use rendezvous hashing unless
asked otherwise.
@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9aba025a-9b42-4c1b-a08f-ae0f05d6e987
📥 Commits

Reviewing files that changed from the base of the PR and between 21779af and 09b704b.

📒 Files selected for processing: 1
  • src/Client.zig

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The client now defaults to rendezvous hashing for key-based operations. A test uses default options with three servers and verifies retrieval of 20 keys after setting them.

Changes: Key routing

Layer / File(s) Summary
Default routing and validation
src/Client.zig
Client.Options.hasher defaults to .rendezvous instead of .none. A test sets and retrieves 20 keys using default options and three servers.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 09b70

The default keeps a key’s set and lookup operations on the same server, and the new test can catch a return to round-robin behavior. No actionable merge-blocking risk remains.

Pre-merge checks: Passed 5
Passed Passed checks: 5 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the primary change: using rendezvous hashing for keys by default.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lalinsky
lalinsky merged commit afb4141 into main Oct 15, 2026
3 checks passed
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

Successfully merging this pull request may close these issues.

1 participant