feat(memberlist): cache serialized local state for push/pull sync #1084
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.35) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 170 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.308
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1084"
general
weight: 0.35
dmatth1
What this PR does:
LocalStatere-serializes the entire KV store on every push/pull sync, while holdingstoreMuexclusively. In a large cluster that burns CPU re-encoding unchanged entries and starves the workers merging incoming updates.This adds an opt-in cache of each store entry's wire form (length prefix + marshalled
KeyValuePair), so a pull is mostly just concatenating cached bytes. Entries are keyed by store key and invalidated byValueDesc.Version—mergeValueForKeymutates values in place, so the version bumped inthat same critical section is the only reliable signal. The cache is guarded by
storeMulikestore, and evicted alongside store entries incleanupObsoleteEntries.LocalStatealso pre-sizes its buffer from the previous payload's size.Off by default behind the experimental
-memberlist.local-state-cache-enabled, since it costs memory proportional to the store; the disabled path behaves exactly as before.local_state_cache_hits_total/local_state_cache_misses_totalmake hit rate observable.BenchmarkLocalStateover a 30-key / ~3.2 MB store (Apple M5 Pro):Which issue(s) this PR fixes:
N/A
Checklist