Skip to content

MOD-12736: Fix FT.HYBRID with LOAD *#8018

Merged
nafraf merged 5 commits intomasterfrom
nafraf_mod-12736
Jan 15, 2026
Merged

MOD-12736: Fix FT.HYBRID with LOAD *#8018
nafraf merged 5 commits intomasterfrom
nafraf_mod-12736

Conversation

@nafraf
Copy link
Collaborator

@nafraf nafraf commented Jan 10, 2026

Describe the changes in the pull request

  1. Current:
    FT.HYBRID + LOAD * was crashing.
    The original code assumed all keys would exist in the destination lookup before RLookupRow_WriteFieldsFrom was called, but with LOAD *, lookup keys are created dynamically during document loading.

  2. Change:

  • Modify RLookupRow_WriteFieldsFrom() to create on-demand the missing keys only when LOAD * is used.
  • Skip initial sync for LOAD * (it's useless - keys don't exist yet)
  1. Outcome:
    FT.HYBRID + LOAD * should work.

Which additional issues this PR fixes

  1. MOD-...
  2. #...

Main objects this PR modified

  1. ...

Mark if applicable

  • This PR introduces API changes
  • This PR introduces serialization changes

Note

Fixes crashes with FT.HYBRID + LOAD * by deferring schema sync and creating missing lookup keys on demand.

  • Add createMissingKeys flow: HybridLookupContext gains a flag; RLookupRow_WriteFieldsFrom(...) now accepts createMissingKeys and creates destination keys if absent (LOAD * case)
  • Propagate LOAD * state: set hreq->reqflags from parsed params; pass flag to merger via HybridLookupContext_New; hybridMergerStoreUpstreamResult uses new API
  • Skip upfront key synchronization when QEXEC_AGG_LOAD_ALL is set; perform it only otherwise (both standalone and coordinator paths)
  • Minor: open score key as before; small comment/format tweaks
  • Tests: update C++ rlookup tests to new signature; add new tests for on-demand key creation; add Python tests validating FT.HYBRID ... LOAD * across field combinations and with yielded scores

Written by Cursor Bugbot for commit de1733f. This will update automatically on new commits. Configure here.

@nafraf nafraf marked this pull request as ready for review January 10, 2026 22:47
@nafraf nafraf changed the title MOD-12736: Fix FT.HYBRID + LOAD * MOD-12736: Fix FT.HYBRID with LOAD * Jan 10, 2026
@codecov
Copy link

codecov bot commented Jan 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.88%. Comparing base (b010ea6) to head (de1733f).
⚠️ Report is 21 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8018      +/-   ##
==========================================
- Coverage   84.08%   83.88%   -0.20%     
==========================================
  Files         361      366       +5     
  Lines       55121    55188      +67     
  Branches    14377    14393      +16     
==========================================
- Hits        46348    46294      -54     
- Misses       8611     8732     +121     
  Partials      162      162              
Flag Coverage Δ
flow 84.89% <100.00%> (-0.14%) ⬇️
unit 50.72% <93.33%> (-0.23%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 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 January 11, 2026 02:58
@oshadmi oshadmi requested review from kei-nan and removed request for kei-nan January 11, 2026 11:59
@Itzikvaknin
Copy link
Collaborator

I haven’t reviewed it yet, but regarding "Modify RLookupRow_WriteFieldsFrom() to create missing keys on demand" -
We originally separated RLookupRow_WriteFieldsFrom from RLookup_AddKeysFrom specifically to keep row operations and schema operations independent.

This change may break that separation. If we decide to go in that direction, we should clean up the code accordingly. Instead of maintaining a mixed state - where we both synchronize the RLookups and dynamically add fields at runtime - we can move fully to a dynamic approach.

Copy link
Collaborator

@Itzikvaknin Itzikvaknin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed this with @kei-nan , and it seems there’s no clean way to make this change without a significant refactor.
Given that, it feels reasonable to go ahead with the current change.

Left a few small comments.

@nafraf nafraf requested review from Itzikvaknin and kei-nan January 14, 2026 10:04
@nafraf nafraf requested a review from kei-nan January 15, 2026 11:35
@nafraf nafraf added this pull request to the merge queue Jan 15, 2026
Merged via the queue into master with commit fa5e536 Jan 15, 2026
47 checks passed
@nafraf nafraf deleted the nafraf_mod-12736 branch January 15, 2026 14:42
@nafraf
Copy link
Collaborator Author

nafraf commented Jan 15, 2026

/backport

@redisearch-backport-pull-request
Copy link
Contributor

Backport failed for 8.4, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin 8.4
git worktree add -d .worktree/backport-8018-to-8.4 origin/8.4
cd .worktree/backport-8018-to-8.4
git switch --create backport-8018-to-8.4
git cherry-pick -x fa5e53694fe47742bc51fc20c3d6806561ca1f4b

nafraf added a commit that referenced this pull request Jan 15, 2026
github-merge-queue bot pushed a commit that referenced this pull request Jan 15, 2026
MOD-12736: Fix FT.HYBRID with LOAD * (#8018)
(cherry picked from commit fa5e536)
JoanFM pushed a commit that referenced this pull request Jan 19, 2026
MOD-12736: Fix FT.HYBRID with LOAD * (#8018)
(cherry picked from commit fa5e536)
JonasKruckenberg added a commit that referenced this pull request Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants