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.
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.
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{ |
| LeaseDuration: 60 * time.Second, | ||
| RenewDeadline: 55 * time.Second, | ||
| RetryPeriod: 2 * time.Second, |
There was a problem hiding this comment.
[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, |
|
@pratheep-kumar @Sasidharan-Gopal please review. This looks like good to have feature. |
Fixes # .
Changes proposed on the PR: