Skip to content

use FNV-1a as documented in rendezvous hashing - #851

Merged
Benjamin Elder (BenTheElder) merged 1 commit into
agent-substrate:mainfrom
mowangdk:fix/rendezvous-fnv1a
Aug 12, 2026
Merged

use FNV-1a as documented in rendezvous hashing#851
Benjamin Elder (BenTheElder) merged 1 commit into
agent-substrate:mainfrom
mowangdk:fix/rendezvous-fnv1a

Conversation

@mowangdk

Copy link
Copy Markdown
Contributor

Summary

The comment on Hasher states the implementation is based on FNV-1a, but fnvhash used fnv.New64() which is FNV-1. Switch to fnv.New64a() to match the documented algorithm and get better distribution.

Why this is safe

The hash function is used solely for live work assignment across controller replicas via rendezvous hashing. No hash values are persisted anywhere.

@google-cla

google-cla Bot commented Aug 11, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request changes the hashing function in rendezvous.go to use fnv.New64a() instead of fnv.New64(). The reviewer points out that using fnv.New64a() with a string-to-byte-slice conversion causes heap allocations, and suggests implementing the FNV-1a algorithm inline to improve performance.

Comment thread cmd/podcertcontroller/internal/rendezvous/rendezvous.go
@BenTheElder
Benjamin Elder (BenTheElder) merged commit 38514e7 into agent-substrate:main Aug 12, 2026
11 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.

3 participants