Add MR_ClusterRefreshTopology for event-driven OSS topology refresh#100
Draft
gabsow wants to merge 1 commit into
Draft
Add MR_ClusterRefreshTopology for event-driven OSS topology refresh#100gabsow wants to merge 1 commit into
gabsow wants to merge 1 commit into
Conversation
Expose MR_ClusterRefreshTopology(): schedules MR_RefreshClusterData on the event loop (no blocked client), gated by clusterCtx.isOss so it is a no-op outside OSS cluster mode. Lets a module refresh the LibMR cluster view from a Redis server-event callback instead of requiring a manual REFRESHCLUSTER. Also vendors the RedisModuleEvent_ClusterTopologyChange definitions (event id 20, subevents, info struct) into the local redismodule.h so consumers can subscribe; this mirrors redis/redis#15350 and will be reconciled by the normal redismodule.h sync. Relates-to: MOD-9152, RED-148990 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
MR_ClusterRefreshTopology()so a consumer module can refresh the LibMR cluster view in response to a Redis server event, instead of requiring an operator to call a manual refresh command (e.g.TIMESERIES.REFRESHCLUSTER) on every primary after each reshard.What it does
MR_ClusterRefreshTopology()schedules the existingMR_RefreshClusterData()on the LibMR event loop (the thread-safe place to mutate topology), with no blocked client to reply to — the difference from the command-drivenMR_ClusterRefresh.clusterCtx.isOss, so it is a no-op outside OSS cluster mode (under Enterprise the DMC drives topology viaCLUSTERSET), mirroring the OSS-only registration ofREFRESHCLUSTER. Safe to call unconditionally from an event callback.cluster.hnext to the otherMR_Cluster*entry points.The local
redismodule.hcopy is updated with theRedisModuleEvent_ClusterTopologyChangedefinitions (id 20) so LibMR consumers compile against the new event; this mirrors redis/redis#15350 and will be reconciled by the normal header sync.Used by the RedisTimeSeries consumer PR (auto-refresh on cluster topology change). Verified end-to-end on a 3-node OSS cluster: topology auto-refreshes on formation and reshard with no manual command.
Depends on / mirrors: redis/redis#15350
Relates-to: MOD-9152, RED-148990
🤖 Generated with Claude Code