Add tombstone GC for GossipListValue - #3
Merged
Merged
Conversation
Tombstones (removed items) were never physically dropped from the entries dict, only ever marked present: false — fine for correctness (each GossipListValue is always replaced as a whole atomic unit via the enclosing GossipApplicationState's version, so there's no per-item merge/resurrection risk the way Cassandra's cell-level tombstones have), but unbounded over a long-running process with many distinct items added then removed. gcTombstonesOlderThan: drops any tombstoned entry whose itemVersion is more than the given gap behind the list's own versionCounter. Uses the list's own logical version clock rather than wall-clock time, since nothing in Gossip carries real timestamps. Deliberately left as an explicit method the caller invokes with its own threshold, not auto-wired into Gossiper's periodic gossip loop — picking a concrete grace window is a policy call that depends on gossip round frequency, not something to default silently. New GossipListValueTest (5 tests) covers add/remove/tombstone semantics and the GC boundary (kept when recent, removed when past the gap, present items never touched). Co-Authored-By: Claude Sonnet 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.
Tombstones (removed items) were never physically dropped from the entries dict, only ever marked present: false — fine for correctness (each GossipListValue is always replaced as a whole atomic unit via the enclosing GossipApplicationState's version, so there's no per-item merge/resurrection risk the way Cassandra's cell-level tombstones have), but unbounded over a long-running process with many distinct items added then removed.
gcTombstonesOlderThan: drops any tombstoned entry whose itemVersion is more than the given gap behind the list's own versionCounter. Uses the list's own logical version clock rather than wall-clock time, since nothing in Gossip carries real timestamps. Deliberately left as an explicit method the caller invokes with its own threshold, not auto-wired into Gossiper's periodic gossip loop — picking a concrete grace window is a policy call that depends on gossip round frequency, not something to default silently.
New GossipListValueTest (5 tests) covers add/remove/tombstone semantics and the GC boundary (kept when recent, removed when past the gap, present items never touched).