Skip to content

[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

Draft
wants to merge 1 commit into
base: ndyakov/CAE-1088-resp3-notification-handlers
Choose a base branch
from

Conversation

ndyakov
Copy link
Member

@ndyakov ndyakov commented Jul 25, 2025

No description provided.

@ndyakov ndyakov force-pushed the ndyakov/CAE-1072-hitless-upgrades-2 branch 2 times, most recently from 49e5814 to 43aef14 Compare July 25, 2025 12:51
@ndyakov ndyakov changed the base branch from ndyakov/CAE-1088-resp3-notification-handlers to master July 25, 2025 12:52
@ndyakov ndyakov force-pushed the ndyakov/CAE-1072-hitless-upgrades-2 branch 21 times, most recently from 8608f93 to a39a23a Compare July 30, 2025 07:05
@ndyakov ndyakov force-pushed the ndyakov/CAE-1072-hitless-upgrades-2 branch 2 times, most recently from e88e673 to 4542e8f Compare August 4, 2025 13:01
@ndyakov ndyakov changed the base branch from master to ndyakov/CAE-1088-resp3-notification-handlers August 4, 2025 13:02
@ndyakov ndyakov force-pushed the ndyakov/CAE-1072-hitless-upgrades-2 branch 3 times, most recently from 9590c26 to 100c3d2 Compare August 4, 2025 13:57
Comment on lines 9 to 12
// Enabled controls whether hitless upgrades are enabled.
// Requires RESP3 protocol for push notifications.
// Default: false
Enabled bool
Copy link
Member Author

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?

Comment on lines 54 to 112
// 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
Copy link
Member Author

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 ?

Comment on lines +81 to +96

// 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
}

Copy link
Member Author

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.

Comment on lines 166 to 173
// 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
}
Copy link
Member Author

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?

@ndyakov ndyakov force-pushed the ndyakov/CAE-1072-hitless-upgrades-2 branch 5 times, most recently from ddaded3 to eefea68 Compare August 12, 2025 20:51
@ndyakov ndyakov force-pushed the ndyakov/CAE-1072-hitless-upgrades-2 branch from eefea68 to a0ba593 Compare August 12, 2025 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant