remote_fw_dram: re-send a refused start_write once with metadata (fixes #51) #52
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 480 lines diff across 6 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.369
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #52"
general
weight: 0.35
rishabhsinha17
Fixes #51
Problem
After a Guard promotion (or a replacement re-attaching at the same control endpoint) the first peer transfer from that endpoint is refused: the target still has the endpoint in
_metadata_acked_sources, so itsstart_writeomitstarget_agent_metadata; the new peer has no peer table for it,_remote_agentraisesmissing target agent metadata, the Guard sendswrite_refused, and the request misses (one full recomputation per peer after every takeover or replacement)._handle_write_refusedalready un-acked the endpoint so the next request republishes metadata — recovery was designed in, one request late.Change
remote_fw_dram._handle_write_refused: after invalidating the endpoint, if the refused_TargetPullOphas not been retried yet, is stillWAITING_WRITE_DONEand inside its deadline, put it back intoSTART_WRITE. The progress loop re-sends the samestart_write, now carryingtarget_agent_metadata(the endpoint is no longer acked), and the operation completes. A second refusal of the same operation is terminal as before (republishedflag).write_refusedcarriesreason: "missing_target_agent_metadata".test_refused_start_write_is_resent_once_with_metadata;test_only_a_refusal_from_this_operation_s_source_finishes_itupdated for the one retry.Validation
Unit:
tests/unit/test_kvcr_remote_target.py,test_guard_integration.py,test_kvcr_service.py— 90 passed.test_promoted_guard_serves_real_nixl_transfers[1-False]fails on the test box identically without this change (pre-existing, real-NIXL local-pool read in the replacement phase),[2-True]passes.End to end (Guard takeover scenario: worker 0 commits a prefix, its engine is SIGKILLed, the Guard takes over its pool, worker 1 then requests the same prefix; Qwen3-0.6B, Guard mode, Dynamo
--router-mode kv+ kv_state_agent, this branch'ssrc/kvcronPYTHONPATHover imagekvcr main 317e62f/ Dynamo8c226c9/ vLLM PR 536247015687c, dynamo-aws-dev-02, Linux 6.17):| Layout | Before | After |
| --- | --- | --- |
| single node, 2×H100, kvcr_service sidecar containers | first request to worker 1 after the takeover misses (
cached_tokens=0,remote_deliver failed) | hit: first requestcached_tokens=1408, 22 blocks / 161 MB delivered || two nodes, 1×H100 each, etcd discovery, cross-node NIXL | same miss | hit, same |
| Kill → first correct Guard-served hit | 5.7 s | 1.3 s (promotion itself 1.0 s, unchanged) |
Before-fix numbers reproduce on every Guard run since 2026-09-25 across dlcluster single-container, dlcluster separate containers, and both Kubernetes layouts.
Update (2026-10-13, rebased on main dbb832d)
Review feedback addressed:
poll_progressafter this cycle's notifications are read, so a terminalwrite_donefor the same op outranks the refusal (completed write kept, not retried).write_refusedcarriesreason: "missing_target_agent_metadata"; any other refusal stays terminal.Relation to #73: #73 reloads NIXL peer metadata on the source side after a typed disconnect. This PR covers the target side after an endpoint takeover (first
start_writesent without metadata). Re-verified on main dbb832d (which includes #73), Qwen3-0.6B, Guard mode, 2×H100. Scenario: worker 0 serves and commits a prefix, its engine is SIGKILLed, the Guard takes over its pool, then worker 1 receives a request with the same prefix.| | main | main + this PR |
| --- | --- | --- |
| First request to worker 1 after the takeover | miss (
cached_tokens=0,remote_deliverfailed) | hit (cached_tokens=1472, 23 blocks) || Kill → first correct Guard-served hit | 2 attempts, 5.6 s | 1 attempt, 1.3 s |