Skip to content

Hitless upgrade support implementation for synchronous Redis client. #3713

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

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

petyaslavova
Copy link
Collaborator

Pull Request check-list

Please make sure to review and check all of these items:

  • Do tests and lints pass with this change?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Is there an example added to the examples folder (if applicable)?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.

Description of change

Hitless upgrade support implementation for synchronous Redis client.

Copy link
Contributor

@Copilot 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 hitless upgrade support for the synchronous Redis client by implementing maintenance event handling and extending the connection and parser layers to react to MOVING, MIGRATING, and MIGRATED push messages.

  • Introduce a new MaintenanceEventsConfig, connection and pool handlers to manage maintenance event lifecycles.
  • Update the Connection, ConnectionPool, and Redis client to wire up maintenance event handlers when RESP3 is used.
  • Add extensive unit and integration tests covering event parsing, pool behavior, and client operations during node maintenance.

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/test_maintenance_events_handling.py New integration tests for MOVING/MIGRATING/MIGRATED event handling
tests/test_maintenance_events.py Unit tests for MaintenanceEvent* classes and pool/connection handlers
tests/test_connection_pool.py Add should_reconnect stub for pool tests
redis/retry.py Log a warning on each retry attempt
redis/maintenance_events.py Core implementation of maintenance event parsing and pool handler
redis/connection.py Extend AbstractConnection to support maintenance events
redis/client.py Wire maintenance event config into Redis client
redis/_parsers/resp3.py Hook maintenance push handlers into RESP3 parser
redis/_parsers/hiredis.py Hook maintenance push handlers into Hiredis parser
redis/_parsers/base.py Define maintenance message types and dispatch to handlers
redis/asyncio/connection.py Add maintenance lock scope to asyncio pool
Comments suppressed due to low confidence (1)

redis/_parsers/resp3.py:209

  • Using a hardcoded id for all MOVING notifications can cause event collisions and prevent correct deduplication; consider parsing a unique ID from the server message or incrementing per‐event.
        # bulk response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant