Skip to content

MOD-12212: Fix high temporary memory consumption when loading search data from RDB.#7336

Merged
Itzikvaknin merged 7 commits intomasterfrom
ivaknin-rdb_load_refactor
Nov 16, 2025
Merged

MOD-12212: Fix high temporary memory consumption when loading search data from RDB.#7336
Itzikvaknin merged 7 commits intomasterfrom
ivaknin-rdb_load_refactor

Conversation

@Itzikvaknin
Copy link
Collaborator

@Itzikvaknin Itzikvaknin commented Nov 12, 2025

Manually backported to 2.10, 2.8:


Note

Defers GC startup and registration to non-duplicate indexes when loading from RDB, and adds a test verifying only one index is stored when duplicates are present.

  • Backend (RDB load):
    • Move IndexSpec_StartGC to run only in the non-duplicate path in IndexSpec_StoreAfterRdbLoad, preventing GC startup for duplicate indexes.
  • Tests:
    • Add testDuplicateIndexRdbLoad to write the same index 30 times to RDB and verify only one is loaded/stored.

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

@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7336      +/-   ##
==========================================
+ Coverage   85.18%   85.20%   +0.01%     
==========================================
  Files         344      346       +2     
  Lines       53001    52978      -23     
  Branches    13708    13731      +23     
==========================================
- Hits        45150    45139      -11     
+ Misses       7656     7645      -11     
+ Partials      195      194       -1     
Flag Coverage Δ
flow 84.57% <100.00%> (+0.11%) ⬆️
unit 52.39% <100.00%> (-0.02%) ⬇️

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.

license: Redis Source Available License 2.0 (RSALv2) or the Server Side Public License v1 (SSPLv1) or the GNU Affero General Public License version 3 (AGPLv3)
command_line_args: ""
compatible_redis_version: "99.99"
compatible_redis_version: "8.2"
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we put this into another PR to isolate changes?

Copy link
Collaborator

Choose a reason for hiding this comment

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

this would clarify the context and socpe, and make backporting easier

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a temporary fix, so i could upload it and test it on master cluster

@Itzikvaknin
Copy link
Collaborator Author

/backport

@redisearch-backport-pull-request
Copy link
Contributor

Only merged pull requests can be backported.

Copy link
Collaborator

@GuyAv46 GuyAv46 left a comment

Choose a reason for hiding this comment

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

Nice and clean

@Itzikvaknin Itzikvaknin requested a review from GuyAv46 November 16, 2025 12:06
@Itzikvaknin Itzikvaknin requested a review from oshadmi November 16, 2025 14:58
@Itzikvaknin Itzikvaknin added this pull request to the merge queue Nov 16, 2025
Merged via the queue into master with commit 0408cde Nov 16, 2025
19 checks passed
@Itzikvaknin Itzikvaknin deleted the ivaknin-rdb_load_refactor branch November 16, 2025 17:02
@redisearch-backport-pull-request
Copy link
Contributor

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

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

git fetch origin 8.2
git worktree add -d .worktree/backport-7336-to-8.2 origin/8.2
cd .worktree/backport-7336-to-8.2
git switch --create backport-7336-to-8.2
git cherry-pick -x 0408cdeb1045059e7982becd4e0b5153b553c783

Itzikvaknin added a commit that referenced this pull request Nov 17, 2025
…data from RDB. (#7336)

* Condition IndexSpec_StartGC and Cursors_initSpec calls on sp->isDuplicate == false

* change compatible_redis_version: "8.2"

* Revert "change compatible_redis_version: "8.2""

This reverts commit 0d1e0bd.

* Add testDuplicateIndexRdbLoad to test the duplicate spec case

* Minor

* Remove index spec validation since the env is not isolated

* Improve testDuplicateIndexRdbLoad
Itzikvaknin added a commit that referenced this pull request Nov 17, 2025
…data from RDB. (#7336)

* Condition IndexSpec_StartGC and Cursors_initSpec calls on sp->isDuplicate == false

* change compatible_redis_version: "8.2"

* Revert "change compatible_redis_version: "8.2""

This reverts commit 0d1e0bd.

* Add testDuplicateIndexRdbLoad to test the duplicate spec case

* Minor

* Remove index spec validation since the env is not isolated

* Improve testDuplicateIndexRdbLoad
@Itzikvaknin
Copy link
Collaborator Author

/backport

@redisearch-backport-pull-request
Copy link
Contributor

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

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

git fetch origin 8.2
git worktree add -d .worktree/backport-7336-to-8.2 origin/8.2
cd .worktree/backport-7336-to-8.2
git switch --create backport-7336-to-8.2
git cherry-pick -x 0408cdeb1045059e7982becd4e0b5153b553c783

redisearch-backport-pull-request bot pushed a commit that referenced this pull request Nov 17, 2025
…data from RDB. (#7336)

* Condition IndexSpec_StartGC and Cursors_initSpec calls on sp->isDuplicate == false

* change compatible_redis_version: "8.2"

* Revert "change compatible_redis_version: "8.2""

This reverts commit 0d1e0bd.

* Add testDuplicateIndexRdbLoad to test the duplicate spec case

* Minor

* Remove index spec validation since the env is not isolated

* Improve testDuplicateIndexRdbLoad

(cherry picked from commit 0408cde)
@redisearch-backport-pull-request
Copy link
Contributor

Itzikvaknin added a commit that referenced this pull request Nov 17, 2025
…data from RDB. (#7336)

* Condition IndexSpec_StartGC and Cursors_initSpec calls on sp->isDuplicate == false

* change compatible_redis_version: "8.2"

* Revert "change compatible_redis_version: "8.2""

This reverts commit 0d1e0bd.

* Add testDuplicateIndexRdbLoad to test the duplicate spec case

* Minor

* Remove index spec validation since the env is not isolated

* Improve testDuplicateIndexRdbLoad
Itzikvaknin added a commit that referenced this pull request Nov 17, 2025
…data from RDB. (#7336)

* Condition IndexSpec_StartGC and Cursors_initSpec calls on sp->isDuplicate == false

* change compatible_redis_version: "8.2"

* Revert "change compatible_redis_version: "8.2""

This reverts commit 0d1e0bd.

* Add testDuplicateIndexRdbLoad to test the duplicate spec case

* Minor

* Remove index spec validation since the env is not isolated

* Improve testDuplicateIndexRdbLoad
Itzikvaknin added a commit that referenced this pull request Nov 17, 2025
…data from RDB. (#7336)

* Condition IndexSpec_StartGC and Cursors_initSpec calls on sp->isDuplicate == false

* change compatible_redis_version: "8.2"

* Revert "change compatible_redis_version: "8.2""

This reverts commit 0d1e0bd.

* Add testDuplicateIndexRdbLoad to test the duplicate spec case

* Minor

* Remove index spec validation since the env is not isolated

* Improve testDuplicateIndexRdbLoad
github-merge-queue bot pushed a commit that referenced this pull request Nov 17, 2025
…earch data from RDB. (#7385)

MOD-12212: Fix high temporary memory consumption when loading search data from RDB. (#7336)

* Condition IndexSpec_StartGC and Cursors_initSpec calls on sp->isDuplicate == false

* change compatible_redis_version: "8.2"

* Revert "change compatible_redis_version: "8.2""

This reverts commit 0d1e0bd.

* Add testDuplicateIndexRdbLoad to test the duplicate spec case

* Minor

* Remove index spec validation since the env is not isolated

* Improve testDuplicateIndexRdbLoad

(cherry picked from commit 0408cde)

Co-authored-by: Itzikvaknin <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Nov 18, 2025
…7384)

* MOD-12212: Fix high temporary memory consumption when loading search data from RDB. (#7336)

* Condition IndexSpec_StartGC and Cursors_initSpec calls on sp->isDuplicate == false

* change compatible_redis_version: "8.2"

* Revert "change compatible_redis_version: "8.2""

This reverts commit 0d1e0bd.

* Add testDuplicateIndexRdbLoad to test the duplicate spec case

* Minor

* Remove index spec validation since the env is not isolated

* Improve testDuplicateIndexRdbLoad

* cleanup

* Minor fix
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.

4 participants