[8.4] MOD-10798, MOD-14095: Support K Ratio argument in FT.HYBRID vector query#8400
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 8.4 #8400 +/- ##
==========================================
- Coverage 85.51% 85.51% -0.01%
==========================================
Files 337 337
Lines 53274 53328 +54
Branches 11023 11023
==========================================
+ Hits 45556 45602 +46
- Misses 7575 7583 +8
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:
|
Co-authored-by: Omer Shadmi <[email protected]>
|
|
||
| return ConcurrentSearch_HandleRedisCommandEx(DIST_THREADPOOL, dist_callback, ctx, argv, argc, | ||
| StrongRef_Demote(spec_ref)); | ||
| &handlerCtx); |
There was a problem hiding this comment.
Uninitialized numShards passed to background
Medium Severity
Some ConcurrentSearchHandlerCtx instances passed into ConcurrentSearch_HandleRedisCommandEx omit .numShards, so ConcurrentCmdCtx->numShards becomes 0 for those background executions, which can silently break any logic that depends on an accurate shard count from ConcurrentCmdCtx_GetNumShards.
Additional Locations (1)
| { | ||
| .name = "shard_k_ratio", | ||
| .token = "SHARD_K_RATIO", | ||
| .since = "8.6.1", |
There was a problem hiding this comment.
@nafraf Need to generate this file with "8.4.7"
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
|





Description
Manual backport #8227 to 8.4
(cherry picked from commit d7ac7d3)
Which additional issues this PR fixes
Main objects this PR modified
Mark if applicable
Release Notes
If a release note is required (bug fix / new feature / enhancement), describe the user impact of this PR in the title.
Note
Medium Risk
Touches hybrid query parsing and distributed coordinator command-building, including cross-thread context plumbing; mistakes could change KNN result counts or break distributed execution, but changes are scoped and covered by new unit/integration tests.
Overview
Adds support for
SHARD_K_RATIOinFT.HYBRIDKNN vector queries (documented incommands.json/command metadata), including validation and duplicate-argument handling.On the coordinator, distributed hybrid execution now computes an effective per-shard K from
K,SHARD_K_RATIO, and shard count, and rewrites the built MR command’s VSIMKargument accordingly. This required extending concurrent command context to carrynumShardsfrom the main thread, factoringSHARD_K_RATIOvalidation into sharedshard_window_ratiohelpers, and adding extensive C++ and Python tests to verify parsing, error cases, and per-shard profiling behavior.Written by Cursor Bugbot for commit d18fcaa. This will update automatically on new commits. Configure here.