[MOD-18471] Fix SVS marked-deletion GC race #1082
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 339 lines diff across 4 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.349
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1082"
general
weight: 0.35
razdoburdin
Summary
GC can finish compacting the SVS index, then a concurrent tiered deletion can increment num_marked_deleted before GC resets the counter to zero. The atomic counter prevents a C++ data race but the unconditional store still loses the logical update because the deletion path previously did not acquire either GC lock. The fix routes all tiered backend deletions through a helper that holds mainIndexGuard shared, while GC already holds that guard exclusively through compaction and the counter reset.
Testing
The before/after tests were run in an isolated build using the repository-pinned SVS revision because the working tree's pre-existing SVS submodule checkout differs from the pinned commit.
Supersedes #1081, which GitHub closed when its head branch was renamed.
<!-- CURSOR_SUMMARY -->
---
<!-- /CURSOR_SUMMARY -->