Repository navigation
fix(cache): bound every cache and broadcast table, with flags and gauges - #119
Merged
Merged
Conversation
The broadcast peer table kept one entry per sender UUID and never dropped one, so every remount and every forged heartbeat grew it. Peers are now kept by address and, like the per-sender sequence tracking, capped at -broadcast-max-peers (256), dropping the node heard from longest ago. The inode, extent and negative caches were LRUs of fixed size, but their Go maps kept the room of evicted keys: the extent cache took 5.8 MB when full and 10.9 MB after 40 times its size went through it. Each shard now rebuilds its map after evicting as many entries as it holds. -cache-inodes, -cache-extents and -cache-negative set the cache sizes, and /metrics reports each limit plus the broadcast table sizes. The create-collision readback no longer waits through read errors other than a missing file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#97's test still used the old AddPeer(uuid, addr) form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What I found, cache by cache:
Measured memory per entry: about 480 B for inodes, 120 B for extents, 40 B for negative entries. These are in API-CONFIG.md.
TestMultiNodeConcurrentCreatesDoNotCollide: #62 already removed the create loop's EIO retry. Its readback still waited through any read error for 15s; now it retries only a missing file or old content.Tests on .68 (load 40–90):
TestCachesStayBounded: fails without the map rebuild.-race, lint and parity: clean.-shortintegration suite: 123/0.The lock "hint cache" gauges are always 0, since locks have no hint cache anymore (the docs already say so). I left them alone.
🤖 Generated with Claude Code