Repository navigation
MOD-17092 FT.HYBRID: forward PARAMS/TIMEOUT from parsed state, not argv re-scan - #10566
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 19fa0fec12
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (len == strlen("YIELD_SCORE_AS") && !strncasecmp(arg, "YIELD_SCORE_AS", len)) { | ||
| i++; // the following token is a user alias, never a keyword |
There was a problem hiding this comment.
Do not skip TIMEOUT after filter terms
In multi-shard FT.HYBRID, this scanner runs before parsing and treats every YIELD_SCORE_AS token as an alias marker, but a counted VSIM filter can legally consume YIELD_SCORE_AS as its filter expression, e.g. ... VSIM @v $BLOB FILTER 1 YIELD_SCORE_AS TIMEOUT 5 PARAMS .... In that case the top-level TIMEOUT immediately after the filter is skipped here, so the blocked-client timeout uses the global default instead of the user's value under FAIL/RETURN_STRICT policies, while the later parsed command still forwards TIMEOUT 5 to shards. Please restrict this skip to positions where YIELD_SCORE_AS <alias> is actually valid, or reuse parsed state for the coordinator timeout too.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
module.c is not modified. The TIMEOUT parsing error is a different issue which affects FT.SEARCH, FT.AGGREGATE, FT.HYBRID, new ticket created: MOD-17165
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #10566 +/- ##
==========================================
- Coverage 83.21% 82.23% -0.98%
==========================================
Files 606 630 +24
Lines 80993 82115 +1122
Branches 36254 37363 +1109
==========================================
+ Hits 67399 67531 +132
- Misses 13247 14237 +990
Partials 347 347
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Itzikvaknin
left a comment
There was a problem hiding this comment.
Left some minor comments
2418913 to
fd63aa9
Compare
Itzikvaknin
left a comment
There was a problem hiding this comment.
Looks good,
2 nitpicks
…_cpp_hybrid_build_mr_cmd.cpp
ce3cbcb to
95914a1
Compare
|
|
🤖 Auto-backport summary
(Summary generated by |
|
/backport-agent 8.10 |
|
🤖 Auto-backport summary
(Summary generated by |
|
/backport-agent 8.6 |
|
🤖 Auto-backport summary
(Summary generated by |
…te, not argv re-scan (#10566) * FT.HYBRID: forward PARAMS/TIMEOUT from parsed state, not argv re-scan * Revert initQueryTimeout() changes * Add HYBRID_NUM_BUF_SIZE constant, address SonarQube comments int test_cpp_hybrid_build_mr_cmd.cpp * Refactor HybridRequest_buildMRCommand to use HybridShardWireParams * Assert HybridCombineWireParams is not NULL in MRCommand_appendCombine (cherry picked from commit e049d94)
…te, not argv re-scan (#10928) MOD-17092 FT.HYBRID: forward PARAMS/TIMEOUT from parsed state, not argv re-scan (#10566) * FT.HYBRID: forward PARAMS/TIMEOUT from parsed state, not argv re-scan * Revert initQueryTimeout() changes * Add HYBRID_NUM_BUF_SIZE constant, address SonarQube comments int test_cpp_hybrid_build_mr_cmd.cpp * Refactor HybridRequest_buildMRCommand to use HybridShardWireParams * Assert HybridCombineWireParams is not NULL in MRCommand_appendCombine (cherry picked from commit e049d94) Co-authored-by: Claude Opus 5 (1M context) <[email protected]>


Description
Current:
_FT.HYBRIDcommand, it reconstructed thePARAMS,TIMEOUT, andDIALECTclauses by re-scanning the rawargvwithRMUtil_ArgIndex("PARAMS"/"TIMEOUT"/"DIALECT", ...). This positional keyword search is fragile: aYIELD_SCORE_ASalias or aPARAMSname/value that happens to be spelledPARAMS,TIMEOUT, orDIALECTis indistinguishable from the real top-level keyword, so the coordinator could misidentify arguments and build a malformed shard command.TIMEOUTwas also relayed verbatim from argvDIALECTwas forwarded despiteFT.HYBRIDrejecting it at parse time.Change:
HybridRequest_buildMRCommandnow takes the already-parsed state instead of re-scanningargv:PARAMSis reconstructed from the resolved parameter dictionary (searchopts.params) via a newMRCommand_appendParamshelper.TIMEOUTis forwarded fromtimeoutSpecified/clientTimeoutMSDIALECTis no longer forwarded (a validFT.HYBRIDnever carries one).Outcome:
YIELD_SCORE_ASaliases or parameter names, the client timeout is forwarded accurately, andDIALECTis no longer needlessly relayed.Which additional issues this PR fixes
Main objects this PR modified
HybridRequest_buildMRCommand+ newMRCommand_appendParams(src/coord/hybrid/dist_hybrid.c/.h)parseHybridCommand/ParseHybridCommandCtx(src/hybrid/parse_hybrid.c/.h)Mark if applicable
Release Notes
Fixes incorrect per-shard command construction for clustered
FT.HYBRIDwhen aYIELD_SCORE_ASalias orPARAMSentry collides with a top-level keyword (PARAMS/TIMEOUT/DIALECT), and forwards the exact client-requested query timeout to shards.