Skip to content

Add tombstone GC for GossipListValue - #3

Merged
noha merged 1 commit into
mainfrom
feature/list-value-tombstone-gc
Jul 23, 2026
Merged

noha merged 1 commit into
mainfrom
feature/list-value-tombstone-gc

Conversation

@noha

@noha noha commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

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).

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>
@noha
noha merged commit 43ce6cf into main Jul 23, 2026
2 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.

1 participant