Skip to content

[8.4] Refactor keys dict - [MOD-13151]#7905

Merged
GuyAv46 merged 1 commit into8.4from
backport-7843-to-8.4
Dec 29, 2025
Merged

[8.4] Refactor keys dict - [MOD-13151]#7905
GuyAv46 merged 1 commit into8.4from
backport-7843-to-8.4

Conversation

@GuyAv46
Copy link
Collaborator

@GuyAv46 GuyAv46 commented Dec 28, 2025

Manual backport of #7843


Note

Modernizes how inverted-index terms are stored and accessed.

  • Replaces keysDict entries from RedisModuleString/KeysDictValue to dict<CharBuf, InvertedIndex*> with custom hash/dup/compare/destructors; updates missingFieldDict val destructor
  • Adds CharBuf type and invIdxDictType; switches term access/deletion to stack CharBuf (no Redis strings)
  • Changes Redis_OpenInvertedIndex (write flag now bool) and Redis_OpenReader APIs to accept RSToken and create RSQueryTerm internally; updates all call sites in query.c
  • Fork GC: uses CharBuf keys for dictDelete, removes string frees, preserves stats updates
  • Renames key-format and drop-scan helpers to legacy: Legacy_fmtRedis{Term,SkipIndex,ScoreIndex}Key, Redis_LegacyDropScanHandler; updates usages in spec.c
  • Minor comment cleanups in field spec info

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

* mark legacy API as such

* refactor spec's keysDict to hold char buffer

* cleanups

* make keysDict a dict for inverted indexes only (simplify value struct)

* use bool

* some comment fixes

* address review comment

* dead code cleanup

(cherry picked from commit 692e14f)
@GuyAv46 GuyAv46 requested a review from ofiryanai December 28, 2025 14:26
@GuyAv46 GuyAv46 enabled auto-merge December 28, 2025 14:27
@codecov
Copy link

codecov bot commented Dec 28, 2025

Codecov Report

❌ Patch coverage is 93.10345% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.04%. Comparing base (d5bc361) to head (f75f3b9).
⚠️ Report is 4 commits behind head on 8.4.

Files with missing lines Patch % Lines
src/query.c 50.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              8.4    #7905      +/-   ##
==========================================
- Coverage   86.10%   86.04%   -0.07%     
==========================================
  Files         332      332              
  Lines       53587    53575      -12     
  Branches    11998    11998              
==========================================
- Hits        46143    46098      -45     
- Misses       7277     7310      +33     
  Partials      167      167              
Flag Coverage Δ
flow 84.65% <93.10%> (-0.19%) ⬇️
unit 52.34% <75.86%> (-0.06%) ⬇️

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.

Copy link
Contributor

@ofiryanai ofiryanai left a comment

Choose a reason for hiding this comment

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

LGTM

@GuyAv46 GuyAv46 added this pull request to the merge queue Dec 29, 2025
Merged via the queue into 8.4 with commit 101ab23 Dec 29, 2025
32 checks passed
@GuyAv46 GuyAv46 deleted the backport-7843-to-8.4 branch December 29, 2025 14:32
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