Repository navigation
Fix RemoveKeys leaving stale keys on the calling peer - #32
Merged
thrawn01 merged 1 commit intoOct 29, 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
After
RemoveKeys, the peer that made the call kept its own cached copies of keys owned by other peers, so later reads there returned the removed value. Removing the same keys one at a time withRemovewas correct. Reported in #27.The calling peer now clears every removed key locally, even when an owner request fails. Errors from peers are still returned. This differs on purpose from
Remove, which returns early and keeps the local copy when the owner fails.Implementation
group.go:RemoveKeyscallsLocalRemovefor every key instead of only the keys this peer owns.LocalRemoveclears both the hot and main cache.remove_keys_test.go:TestRemoveKeysClearsCallerCopiesreads keysa-ethrough daemon 0 on a 3-node cluster, callsRemoveKeys, reads again, and asserts the getter ran twice per key. It failed onmainfor keysb-e(getter ran once) and passes now. The existingTestRemoveKeysuseskey1-key3, which daemon 0 owns, so it never covered this.Verified with
go test -race ./..., all packages pass. A fresh sub-agent reviewed the commit by reading it and found no defect; it could not run tests. Not done: a test for the owner-failure case.Known limit: the caller clears its copy before owners delete theirs, so a concurrent
Geton the caller can reload the old value from an owner in that window.Removehas the same window for non-owner peers, and the ticket asks for the clear to happen even when the owner fails.Fixes ENG-579