-
Notifications
You must be signed in to change notification settings - Fork 2.5k
WIP!: maintnofications for cluster #3601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for SMIGRATING and SMIGRATED notifications to enable cluster slot migration handling in ClusterClient. These notifications allow the client to adapt to cluster topology changes during slot migrations.
- Implements SMIGRATING handler to apply relaxed timeouts during slot migration
- Implements SMIGRATED handler to trigger cluster state reload when migration completes
- Adds callback mechanism for node clients to notify parent ClusterClient of state changes
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| osscluster.go | Registers SMIGRATED callback on node clients to trigger cluster state reload |
| maintnotifications/smigrating_test.go | Comprehensive test coverage for SMIGRATING and SMIGRATED notification handlers |
| maintnotifications/push_notification_handler.go | Implements handleSMigrating and handleSMigrated notification handlers |
| maintnotifications/manager_test.go | Updates test to verify new notification types are registered |
| maintnotifications/manager.go | Adds cluster state reload callback mechanism and new notification constants |
| maintnotifications/README.md | Documents cluster support for SMIGRATING and SMIGRATED notifications |
| internal/maintnotifications/logs/log_messages.go | Adds logging functions for cluster notification handling |
| cluster_smigrating_test.go | Integration tests verifying callback setup and notification handling in cluster context |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // TODO: Should we also clear the relaxed timeout here (like MIGRATED does)? | ||
| // Currently we only trigger state reload, but the timeout stays relaxed |
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The TODO suggests uncertainty about whether relaxed timeouts should be cleared after SMIGRATED. This should be resolved before merging - either clear the timeout (if conn is available) or document why it's intentionally not cleared. Consider the parallel behavior in handleMigrated which clears timeouts on line 290.
| // TODO: Should we also clear the relaxed timeout here (like MIGRATED does)? | |
| // Currently we only trigger state reload, but the timeout stays relaxed | |
| // Clear the relaxed timeout on the connection, if available, to match MIGRATED behavior. | |
| if handlerCtx.Conn != nil { | |
| handlerCtx.Conn.ClearRelaxedTimeout() | |
| } |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This PR is still work in progress.
TODO: