Skip to content

Conversation

@ndyakov
Copy link
Member

@ndyakov ndyakov commented Nov 17, 2025

This PR is still work in progress.

TODO:

Copy link
Contributor

Copilot AI left a 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.

Comment on lines +383 to +384
// TODO: Should we also clear the relaxed timeout here (like MIGRATED does)?
// Currently we only trigger state reload, but the timeout stays relaxed
Copy link

Copilot AI Nov 17, 2025

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.

Suggested change
// 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()
}

Copilot uses AI. Check for mistakes.
@ndyakov ndyakov changed the title WIP!: [CAE-1625] maintnofications for cluster WIP!: maintnofications for cluster Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ClusterOptions missing DialerRetries&DialerRetryTimeout

2 participants