[8.4] MOD-14268: Fix coordinator deadlock under mixed FT.SEARCH + FT.AGGREGATE load (#8774)#9161
[8.4] MOD-14268: Fix coordinator deadlock under mixed FT.SEARCH + FT.AGGREGATE load (#8774)#9161
FT.SEARCH + FT.AGGREGATE load (#8774)#9161Conversation
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 8.4 #9161 +/- ##
==========================================
- Coverage 85.61% 85.55% -0.07%
==========================================
Files 337 337
Lines 53595 53647 +52
Branches 11023 11023
==========================================
+ Hits 45884 45896 +12
- Misses 7568 7608 +40
Partials 143 143
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a481e5f. Configure here.
a481e5f to
2b43639
Compare
|




Backport #8774 to
8.4(cherry picked from commit 9f2f1bb)
Release Notes
Note
Medium Risk
Touches coordinator concurrency and lifetime management (
MRCtxrefcounting, unblock/free callbacks, RQ completion timing), so mistakes could cause leaks or use-after-free, but the change is targeted and includes a new stress regression test.Overview
Fixes a coordinator-side deadlock that could occur under heavy mixed
FT.SEARCH+FT.AGGREGATEload by making MapReduce request lifecycle management safe across async handoffs.This introduces atomic refcounting for
MRCtx, moves RQ-slot completion to the fanout completion path (including the 0-shard-reply case), and reworks distributed search to parse/buildMRCtxon the main thread with explicit privdata cleanup to avoid double replies and premature frees. AddsFT.DEBUG COORD_THREADS STATS(via newConcurrentSearch_getStats) and a regression test that drives the coordinator to saturation and verifies the burst drains without hanging.Reviewed by Cursor Bugbot for commit 2b43639. Bugbot is set up for automated code reviews on this repo. Configure here.