Skip to content

[8.4] Handle ASM Notifications - [MOD-11120]#7149

Merged
redisearch-backport-pull-request[bot] merged 1 commit into8.4from
backport-7022-to-8.4
Oct 24, 2025
Merged

[8.4] Handle ASM Notifications - [MOD-11120]#7149
redisearch-backport-pull-request[bot] merged 1 commit into8.4from
backport-7022-to-8.4

Conversation

@redisearch-backport-pull-request
Copy link
Contributor

@redisearch-backport-pull-request redisearch-backport-pull-request bot commented Oct 24, 2025

Description

Backport of #7022 to 8.4.


Note

Add ASM-aware clustering: cache local slot ranges, filter results during migrations, propagate schemas/dictionaries, and subscribe to new cluster migration events; plus CI tweaks and minor fixes.

  • Cluster/ASM handling:
    • Add slot_ranges module to cache local slot ranges and check access via Slots_CanAccessKeysInSlot.
    • Filter search results by local slots in RPQueryIterator during ASM (should_filter_slots).
    • Subscribe to ClusterSlotMigration and ClusterSlotMigrationTrim events; manage worker threads and toggle slot filtering.
    • Propagate index schemas (Indexes_Propagate via _FT._RESTOREIFNX) and dictionaries (Dictionary_Propagate via _FT.DICTADD) during migration.
    • Drop cached local slots on topology updates and ASM completion.
  • Pipeline/Requests:
    • Pass slot ranges through AREQQueryPipelineParamsRPQueryIterator; manage ownership and lifetimes.
    • Adjust Pipeline_BuildQueryPart signature to accept non-const params.
  • Dictionary:
    • Simplify Dictionary_Add API; add Dictionary_Size, dump tweaks, and cluster propagation support.
  • Notifications:
    • Handle new key_trimmed events; initialize keyspace notifications after spec deserialize.
  • Workers:
    • Allow nested events with counter; workersThreadPool_OnEventEnd now returns status; improved logging.
  • Coordinator/Topology:
    • Drop cached local slots on topology refresh; minor log format fix.
  • CI:
    • Temporarily pin Redis tag to unstable in PR/merge workflows.
  • Tests/Mocks:
    • Add cluster propagation and slot-range tests; extend redismock with cluster APIs; add ASM pytests.

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

* initial registration implementation

* Set up most of the notification events

* address review comment and add logs

* implement propagation

* minor improvements

* small fix

* review fixes

* [TEMP] set CI for new API

* dictionary tidy up

* add first test

* fix helper and test for duplicates

* Add missing sub-command

* add unit-tests for coverage

* change workersThreadPool_OnEvent* behavior to handle overlapping events

* rename events after API update

* implement managed and thread-safe slot ranges API

* drop cached API when needed

* rename API and use in the pipeline

* move includes to C file

* skip current flow test, and introduce a stable one

* fix initial reference count

* implement mock and add a test

* add missing key-space notification subscription

* add a test with adding a new node and propagating the schema

* review fixes

* fix assertion

* leak fix

* use malloc

* leak actual fix

* don't drop the cache on failed events

* add BG variants to flow tests

* update SDK

* Revert "[TEMP] set CI for new API"

This reverts commit 9d2d165.

* use new API RedisModule_ClusterKeySlotC

* run against redis unstable until 8.4 is released

* fix test flakiness - wait for both shards

* increase node timeout for ASM tests

* try adding a sleep

* increase to 5

(cherry picked from commit 3bd770e)
@redisearch-backport-pull-request redisearch-backport-pull-request bot added enforce:coverage Run coverage flow even on draft pull request enforce:sanitize Run sanitizer flow even on draft pull request size:L labels Oct 24, 2025
@codecov
Copy link

codecov bot commented Oct 24, 2025

Codecov Report

❌ Patch coverage is 92.81046% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.53%. Comparing base (48ee400) to head (386ae5d).
⚠️ Report is 7 commits behind head on 8.4.

Files with missing lines Patch % Lines
src/notifications.c 80.85% 9 Missing ⚠️
src/dictionary.c 97.14% 1 Missing ⚠️
src/spec.c 95.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              8.4    #7149      +/-   ##
==========================================
- Coverage   85.67%   85.53%   -0.15%     
==========================================
  Files         327      328       +1     
  Lines       51945    51114     -831     
  Branches    10921    10921              
==========================================
- Hits        44503    43719     -784     
+ Misses       7276     7229      -47     
  Partials      166      166              
Flag Coverage Δ
flow 84.09% <64.70%> (-0.22%) ⬇️
unit 51.57% <55.55%> (-0.03%) ⬇️

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.

@redisearch-backport-pull-request redisearch-backport-pull-request bot added this pull request to the merge queue Oct 24, 2025
Merged via the queue into 8.4 with commit 6a7c646 Oct 24, 2025
28 checks passed
@redisearch-backport-pull-request redisearch-backport-pull-request bot deleted the backport-7022-to-8.4 branch October 24, 2025 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enforce:coverage Run coverage flow even on draft pull request enforce:sanitize Run sanitizer flow even on draft pull request size:L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant