Skip to content

Add maintenance notifications support for OSS API cluster clients#3946

Merged
petyaslavova merged 28 commits intomasterfrom
feat/hitless_upgrade_sync_cluster_client
Feb 13, 2026
Merged

Add maintenance notifications support for OSS API cluster clients#3946
petyaslavova merged 28 commits intomasterfrom
feat/hitless_upgrade_sync_cluster_client

Conversation

@petyaslavova
Copy link
Collaborator

Description
Adds support for smart connection hand-off during maintenance operations for Redis Cloud databases with OSS API enabled.
When a cluster node undergoes maintenance, the client automatically updates its cluster topology and manages connections to ensure minimal disruption (in case the feature is enabled in the server).

Changes

  • New notification types: OSSNodeMigratingNotification and OSSNodeMigratedNotification for OSS cluster maintenance events (SMIGRATING/SMIGRATED push messages)

  • New handler: OSSMaintNotificationsHandler to process cluster-wide maintenance notifications and trigger topology refresh

  • Cluster client integration: MaintNotificationsAbstractRedisCluster mixin adds maintenance notification support to RedisCluster

  • Connection management: Affected connections are marked for reconnect; removed nodes have their connections disconnected

  • Parser updates: Handle new SMIGRATING/SMIGRATED push message types

  • Auto-enabled for RESP3: Maintenance notifications are enabled by default when using protocol version 3

Usage

  from redis.cluster import RedisCluster
  from redis.maint_notifications import MaintNotificationsConfig
  
  # Option 1: Auto-enabled with RESP3 (default config)
  client = RedisCluster(host="localhost", port=6379, protocol=3)
  
  # Option 2: Custom configuration
  config = MaintNotificationsConfig(
      enabled=True,
      proactive_reconnect=True,
      relaxed_timeout=30.0
  )
  client = RedisCluster(
      host="localhost", 
      port=6379, 
      protocol=3,
      maint_notifications_config=config
  )

petyaslavova and others added 10 commits January 29, 2026 10:45
…gration with testing helper proxy server. (#3844)

* Adding maint_notifications_config to RedisCluster's NodesManager

* Adding Redis Proxy integration

* Migrating test proxy helper to use custom https client
…g of SMIGRATING is completed and covered with tests. (#3849)

* Adding maintenance notifications for OSS API enabled connections

* Adding oss maint notifications handler configurations to parsers. Placeholder for smigrated handler in OSSMaintNotificationsHandler class

* Applying review comments. Finilized the notifications format.
* Adding SMIGRATED handling

* Applying Copilot's comments

* Applying review comments
* Refactoring the logic related to SMIGRATED notification format. Applying the new format.

* Add handling for parallel slot migrations with maintenance notifications flow for OSS Cluster API (#3869)

* Adding handling of parallel slot migrations when OSS cluster api is used

* Applying review comments
…ifications e2e tests for node slots migration and node fail over (#3882)

* Adding fault injector abstraction that would be able to work with re fault injector as well as with proxy server

* Adding wrapper that will allow using the mock proxy for e2e tests execution. Updating standalone maint notifications tests. Adding cluster maint notifications test with slot migration and node fail over. Fix in the connection logic when applying relaxed_timeout.

* Apply suggestions from code review

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ifications (#3921)

* Adding tests for new connections. Reorganizing helpers and tests. Cluster db is now created for every test.
…in the src node address for each slot range movement. (#3925)

* Refactoring the SMIGRATED flow - the notification is changed to contain the src node address for each slot range movement.

* Applying review comments and adding additional test step to ensure connections states

* Migarting the last test to use the FI new actions structure

* Completed migration of all oss api hitless tests to use the new FI helpers.

* Applying review comments
@petyaslavova petyaslavova added the feature New feature label Feb 9, 2026
@petyaslavova
Copy link
Collaborator Author

augment review

@augmentcode
Copy link

augmentcode bot commented Feb 9, 2026

🤖 Augment PR Summary

Summary: Adds Redis Cluster maintenance-notification support for Redis Cloud OSS API clusters (hitless topology refresh & connection handoff) when RESP3 push notifications are enabled.

Changes:

  • Introduces OSS-specific maintenance notification types: OSSNodeMigratingNotification and OSSNodeMigratedNotification (SMIGRATING/SMIGRATED).
  • Extends RESP3 push parsing to recognize SMIGRATING/SMIGRATED and route them to appropriate handlers.
  • Adds OSSMaintNotificationsHandler to refresh cluster topology on SMIGRATED and manage reconnect/disconnect of affected node connections.
  • Integrates a new MaintNotificationsAbstractRedisCluster mixin into RedisCluster to wire OSS maintenance handling into all node pools.
  • Updates connection/pool maintenance wiring to support an OSS cluster handler alongside existing moving/migrating handlers.
  • Auto-enables maintenance notifications for RESP3 in cluster initialization when config is not provided.
  • Improves protocol checks via check_protocol_version() and fixes slot=0 handling by using slot is None checks.
  • Adds hashing to ClusterNode and small socket read fix.
  • Adds extensive new tests and proxy helpers, plus docker-compose entries for a RESP proxy test setup.

Technical Notes: The OSS SMIGRATED handler triggers a CLUSTER SLOTS-based reinitialization (optionally seeded with destination nodes) and marks affected connections for reconnect to minimize disruption.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 5 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

@petyaslavova petyaslavova force-pushed the feat/hitless_upgrade_sync_cluster_client branch from 0f7666c to 8db51bb Compare February 10, 2026 07:48
@petyaslavova petyaslavova force-pushed the feat/hitless_upgrade_sync_cluster_client branch from b6b2fee to 1940e7b Compare February 10, 2026 10:00
…ensitive information

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@petyaslavova petyaslavova merged commit 34c73c7 into master Feb 13, 2026
63 checks passed
@petyaslavova petyaslavova deleted the feat/hitless_upgrade_sync_cluster_client branch February 13, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants