Repository navigation
docs: add Design section to README and fix hot cache size - #31
Merged
thrawn01 merged 4 commits intoOct 24, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
The README explained how groupcache works only deep in its internals section, so a visitor couldn't quickly see why they'd pick it. A new "Design" section near the top now tells the story: one owner per key, loads through your
Getter, one load per key, local fallback, main and hot caches, cluster-wideSet/Remove/RemoveKeys, expiry on read, pluggable caches and transports, OpenTelemetry, and many instances per process. Each pattern links to the code behind it.There are no planned features to show. The repo has no designed, unshipped work, and the ticket author confirmed they have none, so the section covers only what ships today.
It also fixes the hot cache size. The hot cache is 1/8 of the group's max bytes (1/7 of the main cache), not 1/8 of the main cache.
Implementation
README.md: replaced "Why Use Groupcache?" and "How It Works" with "Design". The old text said owned keys are served from the hot cache, which is wrong, since the hot cache holds copies of other peers' keys.Set().RemoteSetwrites to the main cache on every peer.How it was checked: a fresh reviewer compared every behavior claim against the code and found five problems (main cache described as owned-only, fallback exceptions, "runs once" overstated, "callers never fill the cache", and the step order). All are fixed in this PR. Links in Design resolve to existing files. Nothing was built or run, since only
README.mdchanged. I did not re-review after the fixes.Fixes ENG-566