-
Notifications
You must be signed in to change notification settings - Fork 7
Lease time modification #22
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: master
Are you sure you want to change the base?
Lease time modification #22
Conversation
There is on major PR pending, will take this after that. |
@emsaravanan this PR has been merge can you please overlay your changes on top of the new code base? |
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 modifies the leader election configuration for the Redis Failover operator by replacing the default leader election service with a custom configuration. The change allows for explicit control over lease timing parameters rather than relying on default values.
- Introduces custom leader election lock configuration with specific timing parameters
- Replaces
leaderelection.NewDefault()
withleaderelection.New()
to use the custom configuration
Comments suppressed due to low confidence (1)
|
||
lockCfg := &leaderelection.LockConfig{ |
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.
Inconsistent indentation detected. This line uses spaces for indentation instead of tabs, which doesn't match the surrounding code's indentation style.
lockCfg := &leaderelection.LockConfig{ | |
lockCfg := &leaderelection.LockConfig{ |
Copilot uses AI. Check for mistakes.
LeaseDuration: 60 * time.Second, | ||
RenewDeadline: 55 * time.Second, | ||
RetryPeriod: 2 * time.Second, |
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] Consider defining the timing values as named constants to improve maintainability and make the configuration more explicit. Magic numbers like 60, 55, and 2 should be documented or extracted as constants.
LeaseDuration: 60 * time.Second, | |
RenewDeadline: 55 * time.Second, | |
RetryPeriod: 2 * time.Second, | |
LeaseDuration: leaseDuration, | |
RenewDeadline: renewDeadline, | |
RetryPeriod: retryPeriod, |
Copilot uses AI. Check for mistakes.
Fixes # .
Changes proposed on the PR: