-
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
c908056
to
bfca15a
Compare
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.
Couldn't see any glaring issues
hitless/config.go
Outdated
if c.Mode == "" { | ||
result.Mode = defaults.Mode | ||
} else { | ||
result.Mode = c.Mode | ||
} |
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.
Nitpick: Can we simplify these if-else blocks
result.Mode = defaults.Mode
if c.Mode != "" {
result.Mode = c.Mode
}
func (c *Config) applyWorkerDefaults(poolSize int) { | ||
// Calculate defaults based on pool size | ||
if poolSize <= 0 { | ||
poolSize = 10 * runtime.GOMAXPROCS(0) |
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.
As noted above, GOMAXPROCS
can lead to throttling
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.
this is the default of the pool at the moment, keeping it here as well. I agree that for containerized this is not correct with older go version.
@@ -73,10 +76,18 @@ func (c *PubSub) conn(ctx context.Context, newChannels []string) (*pool.Conn, er | |||
return c.cn, nil | |||
} | |||
|
|||
if c.opt.Addr == "" { | |||
// TODO(hitless): |
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.
This should remain as a TODO, right?
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.
yes
d03b7fa
to
22e1d74
Compare
d7e7d44
to
e6d4b46
Compare
Hitless Upgrades
Seamless Redis connection handoffs during cluster changes without dropping connections.
Quick Start
Modes
MaintNotificationsDisabled
- Hitless upgrades disabledMaintNotificationsEnabled
- Forcefully enabled (fails if server doesn't support)MaintNotificationsAuto
- Auto-detect server support (default)Configuration
Endpoint Types
EndpointTypeAuto
- Auto-detect based on connection (default)EndpointTypeInternalIP
- Internal IP addressEndpointTypeInternalFQDN
- Internal FQDNEndpointTypeExternalIP
- External IP addressEndpointTypeExternalFQDN
- External FQDNEndpointTypeNone
- No endpoint (reconnect with current config)Auto-Scaling
Workers:
min(PoolSize/2, max(10, PoolSize/3))
when auto-calculatedQueue:
max(20×Workers, PoolSize)
capped byMaxActiveConns+1
or5×PoolSize
Examples:
How It Works
Supported Notifications
MOVING
- Slot moving to new nodeMIGRATING
- Slot in migration stateMIGRATED
- Migration completedFAILING_OVER
- Node failing overFAILED_OVER
- Failover completedHooks (Optional)
Monitor and customize hitless operations:
Metrics Hook Example