Skip to content

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

emsaravanan
Copy link

Fixes # .

Changes proposed on the PR:

@samof76
Copy link
Collaborator

samof76 commented Jun 24, 2025

There is on major PR pending, will take this after that.

@samof76
Copy link
Collaborator

samof76 commented Jul 23, 2025

@emsaravanan this PR has been merge can you please overlay your changes on top of the new code base?

@samof76 samof76 requested review from samof76 and Copilot July 23, 2025 07:02
Copy link

@Copilot Copilot AI left a 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() with leaderelection.New() to use the custom configuration
Comments suppressed due to low confidence (1)

Comment on lines +44 to +45

lockCfg := &leaderelection.LockConfig{
Copy link
Preview

Copilot AI Jul 23, 2025

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.

Suggested change
lockCfg := &leaderelection.LockConfig{
lockCfg := &leaderelection.LockConfig{

Copilot uses AI. Check for mistakes.

Comment on lines +46 to +48
LeaseDuration: 60 * time.Second,
RenewDeadline: 55 * time.Second,
RetryPeriod: 2 * time.Second,
Copy link
Preview

Copilot AI Jul 23, 2025

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.

Suggested change
LeaseDuration: 60 * time.Second,
RenewDeadline: 55 * time.Second,
RetryPeriod: 2 * time.Second,
LeaseDuration: leaseDuration,
RenewDeadline: renewDeadline,
RetryPeriod: retryPeriod,

Copilot uses AI. Check for mistakes.

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.

3 participants