Skip to content

[8.8-rse] MOD-17092 FT.HYBRID: forward PARAMS/TIMEOUT from parsed state, not argv re-scan - #10928

Merged
nafraf merged 1 commit into
8.8-rsefrom
nafraf_backport-pr-10566-to-8.8-rse
Aug 24, 2026
Merged

nafraf merged 1 commit into
8.8-rsefrom
nafraf_backport-pr-10566-to-8.8-rse

Conversation

@nafraf

@nafraf nafraf commented Aug 14, 2026 •

Copy link
Copy Markdown
Collaborator

Backport of #10566 to 8.8-rse.

Original PR

Cherry-pick result

Resolved 7 conflict(s) across 3 files — see Conflict Log below.

8.8-rse is missing one master-only change that this PR builds on top of, which
is the root cause of every C conflict:

Missing on 8.8-rse Effect on the backport
Binary-length-aware coordinator fanout (MR_NewCommandArgvLen, cmdLens[], MRCommand_AppendLiteral) Kept the target's MR_NewCommandArgv / strlen-based command assembly; dropped one master-only test

src/coord/hybrid/dist_hybrid.h, src/hybrid/parse_hybrid.c and
src/hybrid/parse_hybrid.h applied cleanly, so the HybridShardWireParams
refactor (including sendExplainScore), the int *outKArgIndex signature and
the parsed-state capture in front of the foreground query-timeout cap are all
backported verbatim.

The functional core of the PR — reconstructing PARAMS from the resolved
parameter dictionary and forwarding TIMEOUT from parsed state instead of
re-scanning argv — is backported in full.

Verified: ./build.sh TESTS exit 0; RUN_UNIT_TESTS 944/944 (141/141 coordinator
C++); test_hybrid_yield.py 19/19 standalone and 19/19 cluster; 95/95 across
test_hybrid, _timeout, _dialect, _explainscore, _profile, _dist,
_shard_k_ratio and _internal in cluster mode.

Conflict Log

The conflicts span dist_hybrid.c, test_cpp_hybrid_build_mr_cmd.cpp and
test_hybrid_yield.py. Most resolved mechanically — keep the target's command assembly,
take everything else from the PR. Two were incidental: param.h was added to the target's
existing include list rather than master's reorganised one, and the _FT.PROFILE block
follows the same assembly decision as the prologue. The decisions worth recording:

  • Length-aware command assembly dropped — dist_hybrid.c. The incoming prologue and
    _FT.PROFILE block carry a size_t cmdLens[5] recorded alongside cmdArgs[] and capture
    index_name_len. Kept the target's cmdArgs[cmdArgCount++] assembly and its
    RedisModule_StringPtrLen(argv[1], NULL) call. The emitted wire tokens are identical;
    only the length bookkeeping, which MR_NewCommandArgv derives via strlen, is absent.

  • EXPLAINSCORE still forwarded, through MRCommand_Append — dist_hybrid.c:389. The
    incoming side calls MRCommand_AppendLiteral, which does not exist on this branch, so the
    append was rewritten as MRCommand_Append(xcmd, "EXPLAINSCORE", strlen("EXPLAINSCORE")).
    Unlike the 8.6/8.6-rse backports, sendExplainScore stays in HybridShardWireParams
    and testExplainScoreNotForwardedFromArgvText is retained — this branch does forward
    QEXEC_F_SEND_SCOREEXPLAIN to shards.

  • The PR's new lens[oi] assertion was taken — test_cpp_hybrid_build_mr_cmd.cpp:255.
    The PR replaces the verifier's unconditional tail with PARAMS-aware branching that adds
    EXPECT_EQ(xcmd->lens[oi], strlen(inputArgs[ii])); the target's shorter tail had no such
    assertion, so the deletion did not match and the old block was left behind. Kept the PR's
    branching block and removed the leftover tail. The assertion holds without the length-aware
    assembly because MR_NewCommandArgv populates lens through assignCstr → strlen and
    every oracle input is a NUL-terminated C string. Confirmed passing.

  • testBinaryArgsForwardedAtFullLength dropped — the PR only updates this test's call
    site to the new signature, but the test itself is master-only and unportable here: it
    asserts a full byte length for an index name containing an embedded NUL, which
    MR_NewCommandArgv truncates at strlen. Every other test the PR touches or adds is
    retained, including the PARAMS/TIMEOUT and keyword-collision cases and the new
    ...WithParams / ...WithIndexSpecAndParams fixture helpers.

  • Pytest query vector — test_hybrid_yield.py:253. Both sides fix the same tie-breaking
    flakiness in test_hybrid_combine_yield_score_as_both_forms; kept the target's
    [0.0, 0.25] and its explanatory comment over the PR's [1.2, 0.3]. The PR's new
    test_hybrid_yield_score_as_keyword_alias merged cleanly.

Release notes

  • This PR requires release notes
  • This PR does not require release notes

🤖 Generated with Claude Code

…gv 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]>
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
4.9% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@codecov

codecov Bot commented Aug 14, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.43590% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (8.8-rse@adee36c). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/coord/hybrid/dist_hybrid.c 97.29% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             8.8-rse   #10928   +/-   ##
==========================================
  Coverage           ?   81.14%           
==========================================
  Files              ?      561           
  Lines              ?    75623           
  Branches           ?    30506           
==========================================
  Hits               ?    61366           
  Misses             ?    13971           
  Partials           ?      286           
Flag Coverage Δ
flow 82.60% <94.87%> (?)
unit 52.37% <74.35%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nafraf
nafraf requested review from Itzikvaknin and oshadmi August 17, 2026 22:48
@nafraf
nafraf added this pull request to the merge queue Aug 24, 2026
Merged via the queue into 8.8-rse with commit 44c9637 Aug 24, 2026
49 of 50 checks passed
@nafraf
nafraf deleted the nafraf_backport-pr-10566-to-8.8-rse branch August 24, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants