Add REPLICA aliases for deprecated SLAVE terminology in Sentinel#3877
Open
majiayu000 wants to merge 2 commits intoredis:masterfrom
Open
Add REPLICA aliases for deprecated SLAVE terminology in Sentinel#3877majiayu000 wants to merge 2 commits intoredis:masterfrom
majiayu000 wants to merge 2 commits intoredis:masterfrom
Conversation
…is#3817) Redis 5.0 deprecated SLAVE in favor of REPLICA. This adds aliases for the Sentinel APIs to match the modern Redis terminology: - ReplicaNotFoundError (alias for SlaveNotFoundError) - Sentinel.replica_for() (alias for slave_for()) - Sentinel.discover_replicas() (alias for discover_slaves()) - Sentinel.filter_replicas() (alias for filter_slaves()) - SentinelConnectionPool.rotate_replicas() (alias for rotate_slaves()) Both sync and async implementations are updated. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Collaborator
|
Hi @majiayu000, thank you for your contribution. We will review your change soon. |
Add comprehensive tests for the new REPLICA terminology aliases: - test_replica_not_found_error_alias: Verify ReplicaNotFoundError is alias - test_replica_for_alias: Test replica_for() method - test_discover_replicas_alias: Test discover_replicas() method - test_filter_replicas_alias: Test filter_replicas() method - test_rotate_replicas_alias: Test rotate_replicas() method Tests added for both sync and async Sentinel implementations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <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
Fixes #3817
Redis 5.0 deprecated SLAVE in favor of REPLICA. This adds aliases for the Sentinel APIs to match the modern Redis terminology.
Changes
Added the following aliases (both sync and async):
ReplicaNotFoundError(alias forSlaveNotFoundError)Sentinel.replica_for()(alias forslave_for())Sentinel.discover_replicas()(alias fordiscover_slaves())Sentinel.filter_replicas()(alias forfilter_slaves())SentinelConnectionPool.rotate_replicas()(alias forrotate_slaves())Notes
slave_*methods are kept for backward compatibilityredis.sentinelandredis.asyncio.sentinelare updated🤖 Generated with Claude Code