-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[WIP] hitless #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?
[WIP] hitless #3447
Conversation
49e5814
to
43aef14
Compare
8608f93
to
a39a23a
Compare
e88e673
to
4542e8f
Compare
9590c26
to
100c3d2
Compare
100c3d2
to
de641c5
Compare
hitless/config.go
Outdated
// Enabled controls whether hitless upgrades are enabled. | ||
// Requires RESP3 protocol for push notifications. | ||
// Default: false | ||
Enabled bool |
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.
should be enabled by default?
hitless/config.go
Outdated
// PostHandoffRelaxedDuration is how long to keep relaxed timeouts on the new connection | ||
// after a handoff completes. This provides additional resilience during cluster transitions. | ||
// Default: 10 seconds | ||
PostHandoffRelaxedDuration time.Duration |
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.
default should be RelaxedTimeoutDuration*2 ?
|
||
// Register handlers for all hitless upgrade notifications with the client's processor | ||
if err := processor.RegisterHandler("MOVING", handler, true); err != nil { | ||
return err | ||
} | ||
if err := processor.RegisterHandler("MIGRATING", handler, true); err != nil { | ||
return err | ||
} | ||
if err := processor.RegisterHandler("MIGRATED", handler, true); err != nil { | ||
return err | ||
} | ||
if err := processor.RegisterHandler("FAILING_OVER", handler, true); err != nil { | ||
return err | ||
} | ||
if err := processor.RegisterHandler("FAILED_OVER", handler, true); err != nil { | ||
return err | ||
} | ||
|
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.
maybe rewrite in a loop? Try couple of different approaches and decide which works the best.
hitless/hitless_manager.go
Outdated
// GetCurrentState returns current state based on active operations. | ||
func (hm *HitlessManager) GetCurrentState() State { | ||
hm.mu.RLock() | ||
defer hm.mu.RUnlock() | ||
|
||
if len(hm.activeMovingOps) > 0 { | ||
return StateMoving | ||
} | ||
return StateIdle | ||
} |
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.
atomic flag instead of lock?
ddaded3
to
eefea68
Compare
eefea68
to
a0ba593
Compare
No description provided.