You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Port or audit of upstream Kpa-clawbot/CoreScope PR 2327 ("fix(store): release evicted packet references from secondary indexes"). Read the upstream PR and its linked issue for details (read only; never comment there).
What upstream fixed
Upstream found that eviction rebuilt its cleanup keys from SQL paths that can differ from the real node memberships, so evicted packets stayed referenced from secondary indexes (a memory leak). The fix sweeps the real indexes without SQL, clears pointer tails and grouped-cache roots, and rejects stale cache publication. The upstream PR is still open; read it and its issue 2324.
What to do here
Audit first. Find out whether our fork has the same defect. Our code has diverged in several places; do not cherry-pick blindly.
If it applies: port the fix adapted to our code, with a red test before and green after, plus a mutant that the test kills. Include perf numbers where the change touches a hot path.
Our StoreObs/index layout differs (#527, #529, #551, #555, #573). Check EvictStale and every secondary index (byNode, byHash, byTxID, path/subpath, distance, grouped caches) for references that survive eviction. A long-run eviction test that measures retained heap is the likely red test.
Constraints: no SQL under PacketStore.mu; cmd/server stays read-only; no new map[string]interface (Kpa-clawbot#1383); CSS variables only for UI changes.
Activity
dborup commentedon Oct 28, 2026
Fixed by #638 (merged as
a9121cb9579650e5d80d815bb8c9a4b8c3437ce2).