-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[CAE-1072] Hitless Upgrades #3447
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: ndyakov/CAE-1088-resp3-notification-handlers
Are you sure you want to change the base?
[CAE-1072] Hitless Upgrades #3447
Conversation
49e5814
to
43aef14
Compare
8608f93
to
a39a23a
Compare
e88e673
to
4542e8f
Compare
9590c26
to
100c3d2
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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 implements hitless upgrades for Redis connections, enabling seamless connection handoffs during topology changes without interrupting operations. It adds comprehensive support for RESP3 push notifications to handle cluster migration events gracefully.
Key changes include:
- Hitless upgrade manager and pool hooks for event-driven connection handoffs
- Enhanced connection pool with relaxed timeout support and atomic state management
- RESP3 push notification handling for cluster migration events (MOVING, MIGRATING, etc.)
Reviewed Changes
Copilot reviewed 46 out of 48 changed files in this pull request and generated 10 comments.
Show a summary per file
File | Description |
---|---|
universal.go |
Added HitlessUpgradeConfig support to universal options |
redis.go |
Integrated hitless manager and enhanced connection initialization |
options.go |
Added hitless configuration with endpoint auto-detection |
internal/pool/conn.go |
Enhanced connection with atomic handoff state and relaxed timeouts |
internal/pool/pool.go |
Added pool hooks system and improved connection lifecycle management |
hitless/pool_hook.go |
Implemented event-driven connection handoff processing |
hitless/notification_handler.go |
Added RESP3 push notification handlers for cluster events |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
4f069e2
to
adee0a8
Compare
} | ||
|
||
// Use the base dialer to connect to the new endpoint | ||
return ph.baseDialer(ctx, ph.network, net.JoinHostPort(host, port)) |
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.
When MOVING points to a different host/FQDN or an IP, we reuse the original TLS config (including ServerName) while dialing the new endpoint. That can cause hostname verification mismatches (e.g., cert valid for old host, not new host/IP).
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.
Correct. Since there are no certificates transmitted as part of the notification, I am assuming there would be a root level configuration for tls which should cover the new endpoint.
226822f
to
2e47e39
Compare
0baeb53
to
b2228f4
Compare
c908056
to
bfca15a
Compare
Hitless Upgrades
Seamless Redis connection handoffs during topology changes without interrupting operations.
Quick Start
Modes
MaintNotificationsDisabled
: Hitless upgrades are completely disabledMaintNotificationsEnabled
: Hitless upgrades are forcefully enabled (fails if server doesn't support it)MaintNotificationsAuto
: Hitless upgrades are enabled if server supports it (default)Configuration
Worker Scaling
min(10, PoolSize/3)
- scales with pool size, capped at 10max(10, set_value)
- enforces minimum 10 workersQueue Sizing
10 × MaxWorkers
, capped by pool sizeMetrics Hook Example
A metrics collection hook is available in
example_hooks.go
that demonstrates how to monitor hitless upgrade operations:The metrics hook tracks:
Requirements